{"record":{"id":"65d42841cb7755a0","repo":"micro/go-micro","slug":"agent-resume-input-unsupported-agent-implementati","errorCode":null,"errorMessage":"agent resume input: unsupported agent implementation %T","messagePattern":"agent resume input: unsupported agent implementation %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/checkpoint.go","lineNumber":122,"sourceCode":"\t\treturn nil, fmt.Errorf(\"agent run %s is terminal with status %q\", runID, run.Status)\n\t}\n\tmessage := string(run.State.Data)\n\tparentID := run.ParentID\n\ta.mu.Lock()\n\tdefer a.mu.Unlock()\n\tif a.model == nil {\n\t\ta.setup()\n\t}\n\treturn a.askLocked(ctx, run.ID, message, parentID, &run, false)\n}\n\n// ResumeInput resumes a checkpointed agent run that paused via the built-in\n// request_input tool. The supplied input is appended to the original request so\n// the same run can continue with durable checkpoint and completed tool history.\nfunc ResumeInput(ctx context.Context, ag Agent, runID, input string) (*Response, error) {\n\ta, ok := ag.(*agentImpl)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"agent resume input: unsupported agent implementation %T\", ag)\n\t}\n\treturn a.resumeInput(ctx, runID, input)\n}\n\nfunc (a *agentImpl) resumeInput(ctx context.Context, runID, input 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\" || run.State.Stage != agentInputStep {\n\t\treturn nil, fmt.Errorf(\"agent run %s is not waiting for human input\", runID)\n\t}","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/micro/go-micro/blob/24529f140421a11a33b6999ab7944f2021cfd69c/agent/checkpoint.go#L104-L140","documentation":"agent.ResumeInput only works with the library's concrete *agentImpl; it type-asserts the passed Agent and returns this error for any other implementation. Custom Agent wrappers or decorators (e.g. middleware wrapping the agent) lose the concrete type and cannot be used for checkpointed human-input resume.","triggerScenarios":"Passing a wrapped/marshalled Agent (your own struct embedding agent.Agent, a decorator, or a different implementation) into agent.ResumeInput; the assertion ag.(*agentImpl) fails.","commonSituations":"Wrapping agents in telemetry/retry middleware that implements the Agent interface; using a mock/fake agent in code paths that later call ResumeInput; multi-library setups where two different Agent interfaces are bridged.","solutions":["Pass the original *agentImpl returned by the library's agent constructor, not a wrapper, to ResumeInput.","Keep a reference to the unwrapped agent for checkpoint operations while using the wrapper only for Run.","Add an Unwrap() Agent method to your decorator and unwrap before calling ResumeInput.","Use agent.ResumeInput only with agents created by this package's constructor."],"exampleFix":"// before\ntype loggingAgent struct{ agent.Agent } // fails assertion\nresp, err := agent.ResumeInput(ctx, loggingAgent{ag}, runID, input)\n// after\nresp, err := agent.ResumeInput(ctx, ag, runID, input) // raw agent from constructor","handlingStrategy":"type-guard","validationCode":"if _, ok := ag.(*agentimpl.AgentImpl); !ok {\n    return errors.New(\"ResumeInput requires the library's concrete agent\")\n}","typeGuard":"func resumableAgent(ag agent.Agent) bool {\n    _, ok := ag.(*agentimpl.AgentImpl) // concrete impl from this package\n    return ok\n}","tryCatchPattern":"resp, err := agent.ResumeInput(ctx, ag, runID, input)\nif err != nil && strings.Contains(err.Error(), \"unsupported agent implementation\") {\n    // unwrap decorator and retry with the underlying agent\n}","preventionTips":["Keep an unwrapped reference to agents created by the library constructor.","If you decorate agents, expose Unwrap() and unwrap before checkpoint calls.","Never bridge agents across incompatible packages."],"tags":["agent","type-assertion","resume-input","unsupported-type"],"backgroundTag":"unsupported-implementation-type","analyzedSha":"24529f140421a11a33b6999ab7944f2021cfd69c","analyzedAt":"2026-09-01T02:52:24.923Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}