MCPcopy
hub / github.com/claude-code-best/claude-code / markAutonomyRunCancelled

Function markAutonomyRunCancelled

src/utils/autonomyRuns.ts:762–789  ·  view source on GitHub ↗
(
  runId: string,
  rootDir?: string,
  nowMs?: number,
)

Source from the content-addressed store, hash-verified

760}
761
762export async function markAutonomyRunCancelled(
763 runId: string,
764 rootDir?: string,
765 nowMs?: number,
766): Promise<AutonomyRunRecord | null> {
767 const updated = await updateAutonomyRun(
768 runId,
769 current =>
770 current.status === 'queued' || current.status === 'running'
771 ? {
772 ...current,
773 status: 'cancelled',
774 endedAt: nowMs ?? Date.now(),
775 error: undefined,
776 }
777 : null,
778 rootDir,
779 )
780 if (updated?.parentFlowId && updated.parentFlowSyncMode === 'managed') {
781 await markManagedAutonomyFlowStepCancelled({
782 flowId: updated.parentFlowId,
783 runId: updated.runId,
784 rootDir,
785 nowMs: updated.endedAt,
786 })
787 }
788 return updated
789}
790
791export async function finalizeAutonomyRunCompleted(params: {
792 runId: string

Calls 3

updateAutonomyRunFunction · 0.85
nowMethod · 0.80

Tested by

no test coverage detected