zed-industries/zed · error · SandboxError::WslUnavailable

WSL did not respond within {} seconds while preparing the sa

Error message

WSL did not respond within {} seconds while preparing the sandboxed command

What it means

Raised while preparing a sandboxed command on WSL: the WSL-side preparation (path resolution/sandbox wrap setup) did not respond within the configured number of seconds, so the command launch is aborted with the timeout embedded.

Source

Thrown at crates/acp_thread/src/acp_thread.rs:4559

                    if sandbox_wrap.is_some() {
                        let (task_command, task_args) = task::ShellBuilder::new(
                            &Shell::Program("/bin/sh".to_string()),
                            false,
                        )
                        .non_interactive()
                        .redirect_stdin_to_dev_null()
                        .build(Some(command.clone()), &args);
                        let wrap = cx.background_spawn(prepare_sandbox_wrap(
                            task_command,
                            task_args,
                            cwd.clone(),
                            sandbox_wrap,
                            env,
                        ));
                        let timeout = cx.background_executor().timer(WSL_SANDBOX_WRAP_TIMEOUT);
                        let (task_command, task_args, task_env, sandbox) = futures::select_biased! {
                            result = wrap.fuse() => result?,
                            _ = timeout.fuse() => return Err(anyhow::Error::new(
                                sandbox::SandboxError::WslUnavailable(format!(
                                    "WSL did not respond within {} seconds while preparing the sandboxed command",
                                    WSL_SANDBOX_WRAP_TIMEOUT.as_secs()
                                )),
                            )),
                        };
                        (task_command, task_args, task_env, sandbox, None)
                    } else {
                        // No sandbox wrap means we're running unsandboxed, and
                        // on Windows that deliberately changes the shell: the
                        // sandboxed path runs under WSL's Linux bash, but this
                        // fallback uses the host's `shell` against the native cwd.
                        let mut builder = ShellBuilder::new(&Shell::Program(shell), is_windows);
                        if headless {
                            builder = builder.non_interactive();
                        }
                        let (task_command, task_args) = builder
                            .redirect_stdin_to_dev_null()

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Retry the command; first-run provisioning is slow but subsequent runs are fast
  2. Pre-warm the WSL distro and helper so sandbox prep stays under the timeout
  3. Check WSL health (wsl --status) if the distro consistently hangs
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/acp_thread/src/acp_thread.rs:4461 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20). Data as JSON: /api/errors/abee9bc99310a7c5. Report an issue: GitHub.