(input: {
runId: string
pendingToolCallId: string
conversationSnapshot: Record<string, unknown>
agentState: Record<string, unknown>
providerRequest: Record<string, unknown>
})
| 197 | } |
| 198 | |
| 199 | async 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 | |
| 231 | export async function upsertAsyncToolCall(input: { |
| 232 | runId?: string | null |
nothing calls this directly
no test coverage detected