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/tools/mod.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/tools/mod.rs') diff --git a/src/tools/mod.rs b/src/tools/mod.rs index 060dd7b..ddb1004 100644 --- a/src/tools/mod.rs +++ b/src/tools/mod.rs @@ -24,6 +24,19 @@ pub fn approval(name: &str) -> Approval { } } +/// A call with no arguments at all. Every tool here requires at least one, so +/// this is a placeholder some backends emit next to a real call, not an attempt. +pub fn is_placeholder(arguments: &str) -> bool { + let trimmed = arguments.trim(); + if trimmed.is_empty() { + return true; + } + matches!( + serde_json::from_str::(trimmed), + Ok(Value::Object(map)) if map.is_empty() + ) +} + /// Rejects a call that cannot possibly run, before a human is asked to approve /// it. An empty `cmd` used to mean an approval prompt for `run: `. pub fn validate(name: &str, args: &Value) -> Result<(), String> { -- cgit v1.2.3