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

Function markAutonomyRunCompleted

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

Source from the content-addressed store, hash-verified

710}
711
712export async function markAutonomyRunCompleted(
713 runId: string,
714 rootDir?: string,
715 nowMs?: number,
716): Promise<AutonomyRunRecord | null> {
717 const updated = await updateAutonomyRun(
718 runId,
719 current =>
720 current.status === 'queued' || current.status === 'running'
721 ? {
722 ...current,
723 status: 'completed',
724 endedAt: nowMs ?? Date.now(),
725 error: undefined,
726 }
727 : null,
728 rootDir,
729 )
730 if (updated?.parentFlowId && updated.parentFlowSyncMode === 'managed') {
731 await markManagedAutonomyFlowStepCompleted({
732 flowId: updated.parentFlowId,
733 runId: updated.runId,
734 rootDir,
735 nowMs: updated.endedAt,
736 })
737 }
738 return updated
739}
740
741export async function markAutonomyRunFailed(
742 runId: string,

Callers 5

autonomy.test.tsFile · 0.90
runInProcessTeammateFunction · 0.85

Calls 3

updateAutonomyRunFunction · 0.85
nowMethod · 0.80

Tested by

no test coverage detected