zed-industries/zed · error

{error:#}

Error message

{error:#}

What it means

This error string is the plain `{error:#}` formatting of any error returned by the subagent thread when partial output exists handling is bypassed or the error is re-raised without augmentation. It propagates the original error chain (via anyhow's alternate formatting, including causes) to the caller of the subagent flow.

Solutions

  1. Read the full anyhow chain in the message to identify the root cause
  2. Fix the underlying provider/config issue indicated by the root cause
  3. Enable partial-output capture (discard_partial_output = false) to get debugging context on failure
  4. Retry if the cause is a transient network or provider error

Example fix

// before
anyhow!("{error:#}")
// after
anyhow!("subagent task failed: {error:#}")
Defensive patterns

Strategy: try-catch

Try / catch

let output = subagent_task.await.map_err(|error| {
    log::error!("subagent error chain: {error:?}");
    error
})?;

Prevention

When it happens

Trigger: The subagent thread's result is an Err and the error is formatted with `{error:#}` — either because `discard_partial_output` is true or because partial output was empty.

Common situations: Provider authentication failures, rate-limit responses, or malformed tool calls inside the subagent turn abort the thread and bubble up through this formatting.

Related errors


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

Appendix: source

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

                    }),
                },
                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}")
                    }
                })
            }
        })
    }
}

pub struct AcpTerminalHandle {
    terminal: Entity<acp_thread::Terminal>,
    _drop_tx: Option<oneshot::Sender<()>>,
}

impl TerminalHandle for AcpTerminalHandle {
    fn id(&self, cx: &AsyncApp) -> Result<acp::TerminalId> {
        Ok(self.terminal.read_with(cx, |term, _cx| term.id().clone()))
    }

View on GitHub (pinned to 916fc2b8cb)