MCPcopy Index your code
hub / github.com/simstudioai/sim / createRunCheckpoint

Function createRunCheckpoint

apps/sim/lib/copilot/async-runs/repository.ts:199–229  ·  view source on GitHub ↗
(input: {
  runId: string
  pendingToolCallId: string
  conversationSnapshot: Record<string, unknown>
  agentState: Record<string, unknown>
  providerRequest: Record<string, unknown>
})

Source from the content-addressed store, hash-verified

197}
198
199async function createRunCheckpoint(input: {
200 runId: string
201 pendingToolCallId: string
202 conversationSnapshot: Record<string, unknown>
203 agentState: Record<string, unknown>
204 providerRequest: Record<string, unknown>
205}) {
206 return withDbSpan(
207 TraceSpan.CopilotAsyncRunsCreateRunCheckpoint,
208 'INSERT',
209 'copilot_run_checkpoints',
210 {
211 [TraceAttr.RunId]: input.runId,
212 [TraceAttr.CopilotCheckpointPendingToolCallId]: input.pendingToolCallId,
213 },
214 async () => {
215 const [checkpoint] = await db
216 .insert(copilotRunCheckpoints)
217 .values({
218 runId: input.runId,
219 pendingToolCallId: input.pendingToolCallId,
220 conversationSnapshot: input.conversationSnapshot,
221 agentState: input.agentState,
222 providerRequest: input.providerRequest,
223 })
224 .returning()
225
226 return checkpoint
227 }
228 )
229}
230
231export async function upsertAsyncToolCall(input: {
232 runId?: string | null

Callers

nothing calls this directly

Calls 1

withDbSpanFunction · 0.85

Tested by

no test coverage detected