{"record":{"id":"923a114c91045b19","repo":"paperclipai/paperclip","slug":"workflow-eval-delegation-checkpoint-is-missing","errorCode":null,"errorMessage":"workflow eval delegation checkpoint is missing","messagePattern":"workflow eval delegation checkpoint is missing","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/src/eval/live-workflow-executor.ts","lineNumber":305,"sourceCode":"  store: CapabilityLiveSessionStore;\n  transportOptions: CapabilityLiveSessionServiceOptions[\"transportOptions\"];\n}): Promise<{\n  service: CapabilityLiveSessionService;\n  session: CapabilityLiveSession;\n} | null> {\n  const before = input.session.snapshot();\n  const advanced = await advanceDelegationReturnMockState({\n    mockState: before.mockState,\n    parentRunId: before.authority.runId,\n    parentSessionId: before.sessionId,\n    parentTaskId: before.authority.taskId,\n    capabilities: before.authority.capabilities,\n  });\n  if (advanced === null) return null;\n  await input.session.suspend(\"workflow eval delegated child completed\");\n  const checkpoint = await input.store.load(before.sessionId);\n  if (checkpoint === null) {\n    throw new Error(\"workflow eval delegation checkpoint is missing\");\n  }\n  const {\n    providerRunBinding: _providerRunBinding,\n    ...checkpointWithoutBinding\n  } = checkpoint;\n  const at = new Date().toISOString();\n  const updated: CapabilityLiveSessionSnapshot = {\n    ...checkpointWithoutBinding,\n    revision: checkpoint.revision + 1,\n    updatedAt: at,\n    authority: {\n      ...checkpoint.authority,\n      runId: advanced.returnRunId,\n    },\n    mockState: advanced.mockState,\n    stateHistory: [\n      ...(checkpoint.stateHistory ?? []),\n      {","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/eval/live-workflow-executor.ts#L287-L323","documentation":"restoreAfterDelegatedChild suspends the current session and then attempts to load the saved checkpoint for the parent session (before.sessionId) from the store. If the store returns null — no checkpoint was persisted under that id — the executor throws this error, because restoring the parent's delegated state is impossible without the checkpoint.","triggerScenarios":"A delegated child completes and triggers restore, but input.store.load(before.sessionId) returns null because the checkpoint was never saved, was deleted, the store points at a different backend/directory, or the sessionId changed between delegation and restore.","commonSituations":"Ephemeral/in-memory store reset between phases of the eval; pointing the store at the wrong data directory after a config change; a crash or cleanup job removing checkpoints mid-run; resuming an eval run across process restarts with a non-persistent store.","solutions":["Confirm the checkpoint store was configured with a persistent directory and that the same store instance backs both delegation and restore.","Check that before.sessionId is the id actually used when the checkpoint was saved (log both).","Save the checkpoint before suspending/spawning the delegated child if the save path may be skipped.","Re-run the eval from the start if checkpoints were removed; or make restore tolerant by re-deriving parent state when the checkpoint is absent."],"exampleFix":"// before\nconst checkpoint = await input.store.load(before.sessionId);\nif (checkpoint === null) throw new Error('workflow eval delegation checkpoint is missing');\n// after\nconst checkpoint = await input.store.load(before.sessionId);\nif (checkpoint === null) {\n  await input.store.save(before.sessionId, buildCheckpointFromSnapshot(before)); // re-derive instead of throwing\n}","handlingStrategy":"try-catch","validationCode":"const checkpoint = await input.store.load(before.sessionId);\nif (checkpoint === null) throw new Error(`checkpoint for session ${before.sessionId} not persisted before delegation`);","typeGuard":"async function hasCheckpoint(store: CheckpointStore, sessionId: string): Promise<boolean> {\n  return (await store.load(sessionId)) !== null;\n}","tryCatchPattern":"try {\n  await executor.restoreAfterDelegatedChild(/* ... */);\n} catch (err) {\n  if ((err as Error).message === 'workflow eval delegation checkpoint is missing') {\n    logger.error({ sessionId: before.sessionId }, 'checkpoint lost; re-running delegation');\n    return rerunDelegation(before);\n  }\n  throw err;\n}","preventionTips":["Use a persistent checkpoint store directory shared across the whole eval process lifetime.","Save the checkpoint before suspending or spawning the delegated child.","Never delete checkpoint files while an eval run is active.","Log sessionId at both save and load time to catch id drift."],"tags":["eval","checkpoint","persistence","workflow"],"backgroundTag":"record-not-found","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}