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

Function updateAutonomyRun

src/utils/autonomyRuns.ts:235–255  ·  view source on GitHub ↗
(
  runId: string,
  updater: (current: AutonomyRunRecord) => AutonomyRunRecord | null,
  rootDir: string = getProjectRoot(),
)

Source from the content-addressed store, hash-verified

233}
234
235async function updateAutonomyRun(
236 runId: string,
237 updater: (current: AutonomyRunRecord) => AutonomyRunRecord | null,
238 rootDir: string = getProjectRoot(),
239): Promise<AutonomyRunRecord | null> {
240 return withAutonomyPersistenceLock(rootDir, async () => {
241 const runs = await listAutonomyRuns(rootDir)
242 const index = runs.findIndex(run => run.runId === runId)
243 if (index === -1) {
244 return null
245 }
246 const next = updater(cloneRunRecord(runs[index]!))
247 if (!next) {
248 return null
249 }
250 const updated = cloneRunRecord(next)
251 runs[index] = updated
252 await writeAutonomyRuns(runs, rootDir)
253 return updated
254 })
255}
256
257export async function getAutonomyRunById(
258 runId: string,

Callers 4

markAutonomyRunRunningFunction · 0.85
markAutonomyRunCompletedFunction · 0.85
markAutonomyRunFailedFunction · 0.85
markAutonomyRunCancelledFunction · 0.85

Calls 5

getProjectRootFunction · 0.85
listAutonomyRunsFunction · 0.85
cloneRunRecordFunction · 0.85
writeAutonomyRunsFunction · 0.85

Tested by

no test coverage detected