{"record":{"id":"e0dc68478d9d6023","repo":"micro/go-micro","slug":"agent-checkpointed-run-not-found","errorCode":null,"errorMessage":"agent: checkpointed run not found","messagePattern":"agent: checkpointed run not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/stream.go","lineNumber":149,"sourceCode":"\t\tresult := base(ctx, call)\n\t\t_ = sendStreamEvent(ctx, events, &StreamEvent{Type: StreamEventToolEnd, ToolCall: call, Result: result})\n\t\treturn result\n\t}\n\ta.setupWithToolHandler(handler)\n\tdefer a.setupWithToolHandler(nil)\n\treturn a.askLocked(ctx, uuid.New().String(), message, a.parentRunID, nil, true)\n}\n\nfunc (a *agentImpl) resumeWithStreamEvents(ctx context.Context, runID string, events chan<- *StreamEvent) (*Response, error) {\n\tif a.opts.Checkpoint == nil {\n\t\treturn nil, errors.New(\"agent: ResumeStreamAsk requires a checkpoint\")\n\t}\n\trun, ok, err := a.opts.Checkpoint.Load(ctx, runID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !ok {\n\t\treturn nil, errors.New(\"agent: checkpointed run not found\")\n\t}\n\tif run.Status == \"done\" {\n\t\tvar resp Response\n\t\tif err := json.Unmarshal(run.State.Data, &resp); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &resp, nil\n\t}\n\tif terminalAgentRunStatus(run.Status) {\n\t\treturn nil, errors.New(\"agent: checkpointed run is terminal with status \" + run.Status)\n\t}\n\n\ta.mu.Lock()\n\tdefer a.mu.Unlock()\n\tif a.tools == nil {\n\t\ta.tools = ai.NewTools(a.opts.Registry, ai.ToolClient(a.opts.Client))\n\t}\n\tbase := a.toolHandler()","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/micro/go-micro/blob/24529f140421a11a33b6999ab7944f2021cfd69c/agent/stream.go#L131-L167","documentation":"The checkpoint store was consulted for the given runID but reported the run does not exist (Load returned ok=false). Resume cannot proceed without a persisted run state.","triggerScenarios":"Calling ResumeStreamAsk/ResumeStream with a runID that was never created, was created by a different checkpoint store/environment, or was deleted/expired from the store.","commonSituations":"Typo'd or stale runID; pointing at a different database/backend than the one that recorded the run; TTL/cleanup evicted the checkpoint; resuming after switching from in-memory to persistent store (or across processes with memory store).","solutions":["Verify the runID exists in the configured Checkpoint store before resuming","Ensure the same checkpoint backend is used for the run's creation and the resume","Log/persist runIDs durably and check Load's ok flag in your own tooling"],"exampleFix":"// before\nstream, err := agent.ResumeStreamAsk(ctx, ag, runID)\n// after\nif _, ok, _ := store.Load(ctx, runID); !ok {\n    return fmt.Errorf(\"run %s not found\", runID)\n}\nstream, err := agent.ResumeStreamAsk(ctx, ag, runID)","handlingStrategy":"validation","validationCode":"run, ok, err := store.Load(ctx, runID)\nif err != nil || !ok {\n    return fmt.Errorf(\"run %q not found in checkpoint store\", runID)\n}","typeGuard":null,"tryCatchPattern":"stream, err := agent.ResumeStreamAsk(ctx, ag, runID)\nif err != nil && strings.Contains(err.Error(), \"not found\") {\n    return startNewRun(ctx, ag) // runID is stale/unknown\n}","preventionTips":["Persist runIDs in the same durable store used for checkpoints","Verify store configuration (DSN/bucket/path) matches across write and read paths","Check for TTL/cleanup policies that may evict runs before resume"],"tags":["go","agent","checkpoint","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"24529f140421a11a33b6999ab7944f2021cfd69c","analyzedAt":"2026-09-01T02:52:24.923Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}