{"record":{"id":"938db0aaa59f1ece","repo":"zed-industries/zed","slug":"no-response-from-the-agent-you-can-try-messaging-again","errorCode":null,"errorMessage":"No response from the agent. You can try messaging again.","messagePattern":"No response from the agent\\. You can try messaging again\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent/src/agent.rs","lineNumber":3560,"sourceCode":"                            .and_then(|message| {\n                                let content = message.as_agent_message()?\n                                    .content\n                                    .iter()\n                                    .filter_map(|content| match content {\n                                        AgentMessageContent::Text(text) => Some(text.as_str()),\n                                        _ => None,\n                                    })\n                                    .join(\"\\n\\n\");\n                                if content.is_empty() {\n                                    None\n                                } else {\n                                    Some(content)\n                                }\n                            })\n                            .context(\"No response from subagent\")\n                    }),\n                },\n                Ok(None) => Err(anyhow!(\"No response from the agent. You can try messaging again.\")),\n                Err(error) => Err(error),\n            };\n\n            parent_thread\n                .update(cx, |parent_thread, cx| {\n                    parent_thread.unregister_running_subagent(&subagent_session_id, cx)\n                })\n                .ok();\n\n            if discard_partial_output {\n                result\n            } else {\n                result.map_err(|error| {\n                    let partial_output = thread.read_with(cx, |thread, _| thread.subagent_partial_output());\n                    if partial_output.is_empty() {\n                        anyhow!(\"{error:#}\")\n                    } else {\n                        anyhow!(\"{error:#}\\n\\nPartial subagent output (last 3 messages, up to 4096 characters each):\\n\\n{partial_output}\")","sourceCodeStart":3542,"sourceCodeEnd":3578,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/agent/src/agent.rs#L3542-L3578","documentation":"This error is raised when a subagent thread's underlying language-model task completes with an error while `discard_partial_output` is true. The agent framework wraps the subagent's final result and, when partial output is discarded, surfaces the raw model/agent failure unchanged. It tells the parent thread that the subagent session failed and the subagent session is then unregistered.","triggerScenarios":"Calling the agent's subagent spawning flow when the spawned thread's completion future resolves with Err and `discard_partial_output` is set, e.g. the model provider returned an error or the thread was cancelled.","commonSituations":"Model provider outages, invalid API keys configured for the subagent's model, context-length rejections, or user cancellation of a running subagent.","solutions":["Check the subagent's model provider configuration (API key, model name) and retry the request","Inspect the wrapped error message for the underlying provider failure and fix it at the source","If partial output would help debugging, re-run with `discard_partial_output` set to false so the error is augmented with partial messages","Retry the subagent task; transient provider errors often resolve on retry"],"exampleFix":"// before\nlet result = if discard_partial_output { result } else { result.map_err(...) };\n// after\nlet result = result.inspect_err(|error| log::error!(\"subagent failed: {error:#}\"));","handlingStrategy":"try-catch","validationCode":"// Verify subagent config before spawning\nassert!(subagent_request.model.api_key().is_some(), \"subagent model requires credentials\");","typeGuard":"fn has_partial_output(thread: &Thread) -> bool { !thread.subagent_partial_output().is_empty() }","tryCatchPattern":"match subagent_result {\n    Err(error) => log::error!(\"subagent failed: {error:#}\"),\n    Ok(output) => handle(output),\n}","preventionTips":["Validate model credentials before spawning subagents","Set discard_partial_output=false in development for richer failure context","Monitor provider status pages for outages","Add retry with backoff around transient provider errors"],"tags":["subagent","async","llm"],"backgroundTag":"upstream-api-error","analyzedSha":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-09-19T19:09:50.599Z","contentChangedAt":"2026-09-19T19:09:50.599Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}