feat: record agent approvals

This commit is contained in:
Georg Bauer
2026-08-02 09:47:28 +02:00
parent 94ed73e235
commit 118a9d41e0
11 changed files with 154 additions and 19 deletions

View File

@@ -81,6 +81,7 @@ impl App {
self.config.model,
&self.conversation[index - 1].content,
None,
&self.conversation[index - 1].tool_approval_reasons,
)
.is_empty()
{
@@ -191,6 +192,7 @@ impl App {
self.config.model,
&message.content,
stored_result,
&message.tool_approval_reasons,
)
};
if !cards.is_empty() {
@@ -540,9 +542,25 @@ fn tool_cards(cards: Vec<crate::agent::ToolCard>) -> Element<'static, Message> {
.gap(6),
);
}
let mut name = row![text(card.call.name).size(13)]
.spacing(5)
.align_y(Alignment::Center);
if let Some(reason) = &card.approval_reason {
name = name.push(
tooltip(
icon(ICON_ROBOT, 13),
container(text(reason.clone()).size(12))
.padding(8)
.max_width(320)
.style(preference_group_style),
tooltip::Position::Top,
)
.gap(5),
);
}
let mut content = column![
row![
text(card.call.name).size(13),
name,
Space::new().width(Length::Fill),
text(card.state.label()).size(11).color(muted_text()),
actions,