{"record":{"id":"e60bfbfed03acd6c","repo":"zed-industries/zed","slug":"failed-to-send-tool-call-authorization-error","errorCode":null,"errorMessage":"Failed to send tool call authorization: {error}","messagePattern":"Failed to send tool call authorization: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent/src/thread.rs","lineNumber":6631,"sourceCode":"            loop {\n                let settings_changed = async {\n                    if settings_rx.changed().await.is_err() {\n                        std::future::pending::<()>().await;\n                    }\n                };\n                futures::select_biased! {\n                    outcome = (&mut response_rx).fuse() => {\n                        let outcome = outcome.map_err(|_| anyhow!(\"authorization channel closed\"))?;\n                        ensure_tool_call_authorization_not_interrupted(&outcome)?;\n                        return Self::persist_permission_outcome(&outcome, fs.clone(), cx);\n                    }\n                    _ = settings_changed.fuse() => {\n                        // On auto-resolve, we dismiss the prompt UI by\n                        // resolving the tool call's `WaitingForConfirmation`\n                        // status with an internal selected outcome. Dropping\n                        // `response_rx` prevents the synthetic response from\n                        // being delivered back into this loop.\n                        match cx.update(|cx| check_settings(cx)) {\n                            ToolPermissionDecision::Allow => {\n                                drop(response_rx);\n                                stream.resolve_tool_call_authorization(\n                                    &tool_call_id,\n                                    auto_allow_outcome.clone(),\n                                );\n                                return Ok(());\n                            }\n                            ToolPermissionDecision::Deny(reason) => {\n                                drop(response_rx);\n                                stream.resolve_tool_call_authorization(\n                                    &tool_call_id,\n                                    auto_deny_outcome.clone(),\n                                );\n                                return Err(anyhow!(reason));\n                            }\n                            ToolPermissionDecision::Confirm => continue,\n                        }","sourceCodeStart":6613,"sourceCodeEnd":6649,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/agent/src/thread.rs#L6613-L6649","documentation":"Logged when the unbounded_send of a ToolCallAuthorization event (with title/options and a response channel) fails because the receiving end of the event stream is gone. The {error} details the channel failure; the authorization flow cannot proceed and the tool call is left unanswered.","triggerScenarios":"Thrown at crates/agent/src/thread.rs:6495 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The tool call authorization event could not be sent because the stream receiver is gone; cancel the pending authorization and fail the tool call","Retry in a live thread if the teardown was transient","Make sure the tool call is marked errored so it doesn't hang awaiting approval"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}