{"record":{"id":"77a1de38604c6d4d","repo":"micro/go-micro","slug":"agent-run-s-not-found","errorCode":null,"errorMessage":"agent run %s not found","messagePattern":"agent run (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/checkpoint.go","lineNumber":87,"sourceCode":"// calls; failed or in-progress runs continue from the saved input message.\nfunc Resume(ctx context.Context, ag Agent, runID string) (*Response, error) {\n\ta, ok := ag.(*agentImpl)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"agent resume: unsupported agent implementation %T\", ag)\n\t}\n\treturn a.resume(ctx, runID)\n}\n\nfunc (a *agentImpl) resume(ctx context.Context, runID string) (*Response, error) {\n\tif a.opts.Checkpoint == nil {\n\t\treturn nil, fmt.Errorf(\"agent %s has no checkpoint configured\", a.opts.Name)\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, fmt.Errorf(\"agent run %s not found\", runID)\n\t}\n\tif run.Status == \"paused\" {\n\t\tif run.State.Stage == agentInputStep {\n\t\t\treturn nil, fmt.Errorf(\"agent run %s is input-required; resume with ResumeInput\", runID)\n\t\t}\n\t\trun.Status = \"running\"\n\t\trun.State.Stage = agentAskStep\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, fmt.Errorf(\"agent run %s response decode: %w\", runID, err)\n\t\t}\n\t\treturn &resp, nil\n\t}\n\tif terminalAgentRunStatus(run.Status) {\n\t\treturn nil, fmt.Errorf(\"agent run %s is terminal with status %q\", runID, run.Status)\n\t}","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/micro/go-micro/blob/24529f140421a11a33b6999ab7944f2021cfd69c/agent/checkpoint.go#L69-L105","documentation":"This error is returned by agent.Resume when the checkpoint store has no record for the given runID. The library looks up the run via opts.Checkpoint.Load and, when it reports ok=false, it cannot resume anything so it fails fast with the run ID in the message. It guards against resuming runs that were never started with a checkpoint store, already pruned, or addressed with a wrong ID.","triggerScenarios":"Calling agent.Resume(ctx, ag, runID) with a runID that was never saved (agent not created with a Checkpoint option), an expired/purged checkpoint entry, or a typo'd/stale run ID from a different store or process.","commonSituations":"Restarting a service against a different (or in-memory) checkpoint backend than the one that saved the run; TTL-based checkpoint stores evicting old runs; passing a parent/tracing ID instead of the agent run ID; resuming after the run was manually deleted.","solutions":["Verify the runID you pass to agent.Resume matches the ID returned by the original agent run and exists in the same checkpoint store used when the run started.","Confirm the agent was constructed with the same Checkpoint option (store implementation and connection) as when the run was created; re-create runs that were persisted to a different backend.","List pending runs via the checkpoint store's List (or agent's pending listing) to find valid resumable IDs.","Re-run the agent from scratch if the checkpoint is gone; there is nothing to resume."],"exampleFix":"// before\nresp, err := agent.Resume(ctx, ag, \"run-123\") // store actually has \"run-abc\"\n// after\nrunID := respFromOriginalRun.ID // keep the real run ID from when the run started\nresp, err := agent.Resume(ctx, ag, runID)","handlingStrategy":"validation","validationCode":"run, ok, err := ckpt.Load(ctx, runID)\nif err != nil { return err }\nif !ok { return fmt.Errorf(\"run %s missing from checkpoint store\", runID) }\n_, err = agent.Resume(ctx, ag, runID)","typeGuard":null,"tryCatchPattern":"resp, err := agent.Resume(ctx, ag, runID)\nif err != nil {\n    if strings.Contains(err.Error(), \"not found\") {\n        // fall back to starting a new run\n        resp, err = ag.Run(ctx, message)\n    }\n}","preventionTips":["Persist the run ID returned by the original run alongside your business record.","Use the same durable checkpoint store across process restarts and environments.","Monitor checkpoint TTL/eviction so runs aren't purged before resume."],"tags":["agent","checkpoint","run-not-found"],"backgroundTag":"checkpoint-run-not-found","analyzedSha":"24529f140421a11a33b6999ab7944f2021cfd69c","analyzedAt":"2026-09-01T02:52:24.923Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}