zed-industries/zed · error
Failed to send Windows-drive sandbox warning: {error}
Error message
Failed to send Windows-drive sandbox warning: {error} What it means
On Windows, writes targeting a drive outside the sandbox's project drive get a dedicated warning prompt; if sending that ThreadEvent fails, the event-stream receiver is gone and this error wraps the send failure. The write cannot be authorized without a live consumer, so it fails.
Source
Thrown at crates/agent/src/thread.rs:5990
.unbounded_send(Ok(ThreadEvent::ToolCallAuthorization(
ToolCallAuthorization {
tool_call: acp::ToolCallUpdate::new(
tool_call_id,
// Leave the title untouched so the card keeps
// showing the command (matching the escalation
// flow).
acp::ToolCallUpdateFields::new(),
)
.meta(acp_thread::meta_with_sandbox_authorization(details)),
options,
response: response_tx,
context: None,
kind: acp_thread::AuthorizationKind::PermissionGrant,
},
)))
{
log::error!("Failed to send Windows-drive sandbox warning: {error}");
return Err(anyhow!(
"Failed to send Windows-drive sandbox warning: {error}"
));
}
let outcome = response_rx
.await
.map_err(|_| anyhow!("authorization channel closed"))?;
ensure_tool_call_authorization_not_interrupted(&outcome)?;
match acp_thread::SandboxPermission::from_id(outcome.option_id.0.as_ref()) {
Some(acp_thread::SandboxPermission::AllowOnce) => Ok(()),
_ => Err(anyhow!("Windows-drive write aborted by user")),
}
})
}
fn sandbox_request_covered_by_grants(
request: &SandboxRequest,
sandbox_grants: &Rc<RefCell<ThreadSandboxGrants>>,View on GitHub (pinned to bc538def45)
Solutions
- Keep the ThreadEvent receiver alive for the thread's whole lifetime
- Handle the error as cancellation and roll back the pending write
- Restrict sandboxed writes to the project drive to avoid the cross-drive prompt entirely
- Cancel the thread before closing the UI so pending warnings resolve as cancelled turns
Defensive patterns
Strategy: try-catch
Try / catch
if let Err(err) = windows_drive_warning_result {
if err.to_string().starts_with("Failed to send Windows-drive sandbox warning") {
// Event consumer is gone: treat as cancellation and roll back the write.
abort_pending_write();
return Ok(());
}
return Err(err);
} Prevention
- Keep the ThreadEvent receiver alive for the thread's whole lifetime
- Cancel the thread before closing the UI so pending warnings resolve as cancelled turns
- Restrict sandboxed writes to the project drive to avoid cross-drive prompts entirely
- Answer or explicitly deny pending prompts during teardown
When it happens
Trigger: A sandboxed tool attempts a write to another Windows drive while the thread's event receiver has been dropped (UI closed or client disconnected), so the warning event cannot be delivered.
Common situations: Windows users writing to absolute paths on other drives with the agent panel closed mid-turn; client reloads during cross-drive operations.
Related errors
- Failed to send sandbox authorization: {error}
- Failed to send sandbox fallback authorization: {error}
- authorization channel closed
- Failed to send tool call decision prompt: {error}
- Windows-drive write aborted by user
AI-assisted analysis of zed-industries/zed@bc538def45 (2026-08-16).
Data as JSON: /api/errors/b4cdc507f93b759a.
Report an issue: GitHub.