Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/agent2/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ async fn test_tool_authorization(cx: &mut TestAppContext) {
tool_name: ToolRequiringPermission::name().into(),
is_error: true,
content: "Permission to run tool denied by user".into(),
output: None
output: Some("Permission to run tool denied by user".into())
})
]
);
Expand Down
14 changes: 12 additions & 2 deletions crates/agent2/src/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,17 @@ impl Thread {
stream.update_tool_call_fields(
&tool_use.id,
acp::ToolCallUpdateFields {
status: Some(acp::ToolCallStatus::Completed),
status: Some(
tool_result
.as_ref()
.map_or(acp::ToolCallStatus::Failed, |result| {
if result.is_error {
acp::ToolCallStatus::Failed
} else {
acp::ToolCallStatus::Completed
}
}),
),
raw_output: output,
..Default::default()
},
Expand Down Expand Up @@ -1557,7 +1567,7 @@ impl Thread {
tool_name: tool_use.name,
is_error: true,
content: LanguageModelToolResultContent::Text(Arc::from(error.to_string())),
output: None,
output: Some(error.to_string().into()),
},
}
}))
Expand Down
7 changes: 4 additions & 3 deletions crates/agent_ui/src/acp/thread_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,7 @@ impl AcpThreadView {
div()
.relative()
.mt_1p5()
.ml(px(7.))
.ml(rems(0.4))
.pl_4()
.border_l_1()
.border_color(self.tool_card_border_color(cx))
Expand Down Expand Up @@ -1850,6 +1850,7 @@ impl AcpThreadView {
.w_full()
.h(window.line_height() - px(2.))
.text_size(self.tool_name_font_size())
.gap_0p5()
.child(tool_icon)
.child(if tool_call.locations.len() == 1 {
let name = tool_call.locations[0]
Expand Down Expand Up @@ -1968,7 +1969,7 @@ impl AcpThreadView {

v_flex()
.mt_1p5()
.ml(px(7.))
.ml(rems(0.4))
.px_3p5()
.gap_2()
.border_l_1()
Expand Down Expand Up @@ -2025,7 +2026,7 @@ impl AcpThreadView {
let button_id = SharedString::from(format!("item-{}", uri));

div()
.ml(px(7.))
.ml(rems(0.4))
.pl_2p5()
.border_l_1()
.border_color(self.tool_card_border_color(cx))
Expand Down
Loading