Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

acp: Allow permissions on existing terminal tool calls (#49270)

Ben Brandtc5bfa93bfbb6
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 1e8c7d35a3c..264897b3188 100644
--- a/crates/agent_ui/src/acp/thread_view/active_thread.rs
+++ b/crates/agent_ui/src/acp/thread_view/active_thread.rs
@@ -4479,6 +4479,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 =
@@ -4547,7 +4553,7 @@ impl AcpThreadView {
.color(Color::Muted),
),
)
- .when(!command_finished, |header| {
+ .when(!command_finished && !needs_confirmation, |header| {
header
.gap_1p5()
.child(
@@ -4725,6 +4731,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()
}