(sessionID: string, snapshot?: string, error?: string)
| 186 | } |
| 187 | |
| 188 | export async function updateChildSnapshot(sessionID: string, snapshot?: string, error?: string) { |
| 189 | await Session.update(sessionID, (draft) => { |
| 190 | if (draft.benchmark?.type === "child") { |
| 191 | if (snapshot) draft.benchmark.lastSnapshot = snapshot |
| 192 | if (error) draft.benchmark.error = error |
| 193 | if (!error) draft.benchmark.error = undefined |
| 194 | } |
| 195 | }) |
| 196 | } |
| 197 | |
| 198 | export async function latestSnapshot(sessionID: string) { |
| 199 | const messages = await Session.messages({ sessionID }) |