From e64f314787301bc4f618b374014d5cf329b6f9aa Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Mon, 16 Feb 2026 16:15:34 +0000 Subject: [PATCH] acp: Allow permissions on existing terminal tool calls (#49270) (cherry-pick to preview) (#49271) Cherry-pick of #49270 to preview ---- 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 Co-authored-by: Ben Brandt --- .../src/acp/thread_view/active_thread.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/crates/agent_ui/src/acp/thread_view/active_thread.rs b/crates/agent_ui/src/acp/thread_view/active_thread.rs index fe296c6f9e0abe7b5fc7926d23eed7a37e5e0633..2671b0f81f66eb2b2d71fd4c62a0e2de9f208d44 100644 --- a/crates/agent_ui/src/acp/thread_view/active_thread.rs +++ b/crates/agent_ui/src/acp/thread_view/active_thread.rs @@ -4364,6 +4364,12 @@ impl AcpThreadView { 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 = @@ -4432,7 +4438,7 @@ impl AcpThreadView { .color(Color::Muted), ), ) - .when(!command_finished, |header| { + .when(!command_finished && !needs_confirmation, |header| { header .gap_1p5() .child( @@ -4610,6 +4616,14 @@ impl AcpThreadView { })), ) }) + .when_some(confirmation_options, |this, options| { + this.child(self.render_permission_buttons( + options, + entry_ix, + tool_call.id.clone(), + cx, + )) + }) .into_any() }