From 0ef2b709b5ec2d44fc947a8b96572f66ee8b3bc9 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 15 Nov 2026 18:31:16 +0100 Subject: 0.7.1: drop argument-less tool calls, print each command once - a name+no-arguments placeholder is removed before the assistant message is recorded, instead of prompting for an empty command - the bash prompt shows the command; the tool line shows only the name - the edit prompt no longer repeats the path already shown above --- src/agent.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/agent.rs') diff --git a/src/agent.rs b/src/agent.rs index f0e1292..7d4c4ef 100644 --- a/src/agent.rs +++ b/src/agent.rs @@ -217,6 +217,16 @@ pub fn run_turn( Err(error) => return Err(error), }; + // Placeholders are dropped before the assistant message is written: + // recording a call we refuse to run would leave it unanswered. + let before = outcome.tool_calls.len(); + outcome + .tool_calls + .retain(|call| !tools::is_placeholder(&call.arguments)); + if outcome.tool_calls.len() < before { + eprintln!("agent686: ignored {} empty tool call(s) from the model", before - outcome.tool_calls.len()); + } + // A missing id would make the tool result unattachable. for (index, call) in outcome.tool_calls.iter_mut().enumerate() { if call.id.is_empty() { @@ -351,7 +361,10 @@ fn execute( )) } }; - ui::tool_line(step, &call.name, &args); + // The bash approval prompt prints the command; do not print it here too. + let repeat_detail = !(tools::approval(&call.name) == Approval::EveryCall + && approver.will_prompt_bash()); + ui::tool_line(step, &call.name, &args, repeat_detail); if let Err(error) = tools::validate(&call.name, &args) { return ToolOutcome::Failed(format!("{error}; the call was not run")); } -- cgit v1.2.3