MCPcopy
hub / github.com/TanStack/ai / finish

Method finish

packages/ai-sandbox/src/run-log.ts:173–188  ·  view source on GitHub ↗
(
    runId: string,
    status: TerminalRunStatus,
    error?: RunError,
  )

Source from the content-addressed store, hash-verified

171 }
172
173 finish(
174 runId: string,
175 status: TerminalRunStatus,
176 error?: RunError,
177 ): Promise<void> {
178 const state = this.runs.get(runId)
179 if (!state) {
180 return Promise.reject(new Error(`run-log: unknown runId "${runId}"`))
181 }
182 if (isTerminalRunStatus(state.record.status)) return Promise.resolve()
183 state.record.status = status
184 if (error !== undefined) state.record.error = error
185 state.record.updatedAt = this.now()
186 this.wake(state)
187 return Promise.resolve()
188 }
189
190 get(runId: string): Promise<RunRecord | null> {
191 const state = this.runs.get(runId)

Callers 2

pipeToRunLogFunction · 0.45
run-log.test.tsFile · 0.45

Calls 5

nowMethod · 0.95
wakeMethod · 0.95
resolveMethod · 0.80
isTerminalRunStatusFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected