{"record":{"id":"c5f39ce93807dbc3","repo":"micro/go-micro","slug":"agent-run-s-is-input-required-resume-with-resume","errorCode":null,"errorMessage":"agent run %s is input-required; resume with ResumeInput","messagePattern":"agent run (.+?) is input-required; resume with ResumeInput","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/checkpoint.go","lineNumber":91,"sourceCode":"\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}\n\tmessage := string(run.State.Data)\n\tparentID := run.ParentID\n\ta.mu.Lock()\n\tdefer a.mu.Unlock()","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/micro/go-micro/blob/24529f140421a11a33b6999ab7944f2021cfd69c/agent/checkpoint.go#L73-L109","documentation":"agent.Resume rejects runs that are paused in the \"input-required\" stage because a plain resume cannot satisfy the run's pending request for human input. The library requires the caller to use agent.ResumeInput, which appends the supplied human input to the original message and continues the same run. This prevents silently resuming a run whose last tool call was the built-in request_input tool without providing the requested data.","triggerScenarios":"Calling agent.Resume on a run whose checkpoint has Status==\"paused\" and State.Stage==agentInputStep (\"input-required\"), i.e. the run ended its last turn by invoking the request_input tool.","commonSituations":"A workflow where the agent asked a clarifying question via request_input and the developer's automation retries Resume in a generic polling loop; mixing up Resume and ResumeInput in code that handles both approval-paused and input-paused runs.","solutions":["Call agent.ResumeInput(ctx, ag, runID, input) instead of agent.Resume, supplying the answer the agent requested.","Inspect the paused run's state/stage (via the checkpoint store) to decide between Resume and ResumeInput in your orchestration code.","Configure the agent to avoid request_input if human input is not expected, or route input-required pauses to a human-in-the-loop UI."],"exampleFix":"// before\nresp, err := agent.Resume(ctx, ag, runID) // run is paused awaiting input\n// after\nresp, err := agent.ResumeInput(ctx, ag, runID, \"Yes, use the staging database\")","handlingStrategy":"try-catch","validationCode":"run, ok, _ := ckpt.Load(ctx, runID)\nneedsInput := ok && run.Status == \"paused\" && run.State.Stage == \"input-required\"","typeGuard":null,"tryCatchPattern":"resp, err := agent.Resume(ctx, ag, runID)\nif err != nil && strings.Contains(err.Error(), \"input-required\") {\n    resp, err = agent.ResumeInput(ctx, ag, runID, answerFromUser)\n}","preventionTips":["Inspect run stage before choosing Resume vs ResumeInput.","Route input-required pauses to a human-in-the-loop handler.","Avoid blanket retry loops around Resume for paused runs."],"tags":["agent","checkpoint","human-input","pause"],"backgroundTag":"agent-run-awaiting-input","analyzedSha":"24529f140421a11a33b6999ab7944f2021cfd69c","analyzedAt":"2026-09-01T02:52:24.923Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}