zed-industries/zed · error

No response from the agent. You can try messaging again.

Error message

No response from the agent. You can try messaging again.

What it means

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.

Solutions

  1. Check the subagent's model provider configuration (API key, model name) and retry the request
  2. Inspect the wrapped error message for the underlying provider failure and fix it at the source
  3. If partial output would help debugging, re-run with `discard_partial_output` set to false so the error is augmented with partial messages
  4. Retry the subagent task; transient provider errors often resolve on retry

Example fix

// before
let result = if discard_partial_output { result } else { result.map_err(...) };
// after
let result = result.inspect_err(|error| log::error!("subagent failed: {error:#}"));
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify subagent config before spawning
assert!(subagent_request.model.api_key().is_some(), "subagent model requires credentials");

Type guard

fn has_partial_output(thread: &Thread) -> bool { !thread.subagent_partial_output().is_empty() }

Try / catch

match subagent_result {
    Err(error) => log::error!("subagent failed: {error:#}"),
    Ok(output) => handle(output),
}

Prevention

When it happens

Trigger: 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.

Common situations: Model provider outages, invalid API keys configured for the subagent's model, context-length rejections, or user cancellation of a running subagent.

Related errors


AI-assisted analysis of zed-industries/zed@916fc2b8cb (2026-09-19). Data as JSON: /api/errors/938db0aaa59f1ece. Report an issue: GitHub.

Appendix: source

Thrown at crates/agent/src/agent.rs:3560

                            .and_then(|message| {
                                let content = message.as_agent_message()?
                                    .content
                                    .iter()
                                    .filter_map(|content| match content {
                                        AgentMessageContent::Text(text) => Some(text.as_str()),
                                        _ => None,
                                    })
                                    .join("\n\n");
                                if content.is_empty() {
                                    None
                                } else {
                                    Some(content)
                                }
                            })
                            .context("No response from subagent")
                    }),
                },
                Ok(None) => Err(anyhow!("No response from the agent. You can try messaging again.")),
                Err(error) => Err(error),
            };

            parent_thread
                .update(cx, |parent_thread, cx| {
                    parent_thread.unregister_running_subagent(&subagent_session_id, cx)
                })
                .ok();

            if discard_partial_output {
                result
            } else {
                result.map_err(|error| {
                    let partial_output = thread.read_with(cx, |thread, _| thread.subagent_partial_output());
                    if partial_output.is_empty() {
                        anyhow!("{error:#}")
                    } else {
                        anyhow!("{error:#}\n\nPartial subagent output (last 3 messages, up to 4096 characters each):\n\n{partial_output}")

View on GitHub (pinned to 916fc2b8cb)