From 81e765243025bc8b1770d82660cb7a56c4dbdfae Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Mon, 16 Feb 2026 18:06:05 +0100 Subject: [PATCH] acp: Allow permissions on existing terminal tool calls (#49270) (#49275) It is possible, when the agent is streaming the tool call, that we will get a permission request on an existing terminal and we need to render that. When Zed controls the terminal this won't happen, but when we are just rendering the output, it can happen and we need to show it. Release Notes: - agent: Fix permission options not rendering on terminal commands --- crates/agent_ui/src/acp/thread_view.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs index 1e9ff72f3d8c6bd094c886d3a74e36acfdba49e5..5c2cfcd27188d248686fcc94e9481e22fa2917c0 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -4669,6 +4669,12 @@ impl AcpServerView { ToolCallStatus::Rejected | ToolCallStatus::Canceled | ToolCallStatus::Failed ); + let confirmation_options = match &tool_call.status { + ToolCallStatus::WaitingForConfirmation { options, .. } => Some(options), + _ => None, + }; + let needs_confirmation = confirmation_options.is_some(); + let output = terminal_data.output(); let command_finished = output.is_some(); let truncated_output = @@ -4741,7 +4747,7 @@ impl AcpServerView { .color(Color::Muted), ), ) - .when(!command_finished, |header| { + .when(!command_finished && !needs_confirmation, |header| { header .gap_1p5() .child( @@ -4924,6 +4930,14 @@ impl AcpServerView { })), ) }) + .when_some(confirmation_options, |this, options| { + this.child(self.render_permission_buttons( + options, + entry_ix, + tool_call.id.clone(), + cx, + )) + }) .into_any() }