zed-industries/zed · error

Resuming subagent sessions is not supported

Error message

Resuming subagent sessions is not supported

What it means

Default implementation of ThreadEnvironment::resume_subagent in crates/agent/src/thread.rs. Environments that only implement create_subagent cannot resume a subagent session by id, so they return this error.

Source

Thrown at crates/agent/src/thread.rs:774

pub trait ThreadEnvironment {
    fn create_terminal(
        &self,
        command: String,
        extra_env: Vec<acp::EnvVariable>,
        cwd: Option<PathBuf>,
        output_byte_limit: Option<u64>,
        sandbox_wrap: Option<acp_thread::SandboxWrap>,
        cx: &mut AsyncApp,
    ) -> Task<Result<Rc<dyn TerminalHandle>>>;

    fn create_subagent(&self, label: String, cx: &mut App) -> Result<Rc<dyn SubagentHandle>>;

    fn resume_subagent(
        &self,
        _session_id: acp::SessionId,
        _cx: &mut App,
    ) -> Result<Rc<dyn SubagentHandle>> {
        Err(anyhow::anyhow!(
            "Resuming subagent sessions is not supported"
        ))
    }

    /// Creates an independent sibling thread visible in the agent sidebar.
    /// Unlike subagents, sibling threads are first-class threads that persist
    /// and run in parallel without reporting results back to the parent.
    fn create_sibling_thread(
        &self,
        request: SiblingThreadRequest,
        cx: &mut AsyncApp,
    ) -> Task<Result<SiblingThreadInfo>> {
        let _ = request;
        let _ = cx;
        Task::ready(Err(anyhow::anyhow!(
            "Creating sibling threads is not supported in this environment"
        )))
    }

View on GitHub (pinned to bc538def45)

Solutions

  1. Implement resume_subagent in your ThreadEnvironment if you persist subagent sessions.
  2. Otherwise create a new subagent via create_subagent and re-feed the needed context.
  3. Attempt resume and fall back to create when it fails.
Defensive patterns

Strategy: fallback

Try / catch

match environment.resume_subagent(session_id.clone(), cx) {
    Ok(handle) => handle,
    Err(e) if e.to_string().contains("Resuming subagent sessions is not supported") => {
        environment.create_subagent(label, cx)? // fall back to a fresh subagent
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling resume_subagent on a ThreadEnvironment that did not override it — custom embedded environments, test doubles, any non-native host.

Common situations: Custom ThreadEnvironment implementations; headless tests; code assuming all environments support subagent persistence.

Related errors


AI-assisted analysis of zed-industries/zed@bc538def45 (2026-08-16). Data as JSON: /api/errors/ba70d94c2d9be921. Report an issue: GitHub.