From 8ae5bd48cf233315b5f36a7a6b39002a5e77f74b Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 15 Nov 2026 18:00:12 +0100 Subject: 0.7.0: resume shows where you left off; no approval for unparsable calls - --continue prints the last answer, or the last reasoning block if there was none - tool arguments are validated before prompting, so an empty bash call becomes an error for the model instead of a blank approval - empty placeholder tool calls are dropped and reported - sessions tolerate invalid UTF-8 lines from a torn write - AGENT686_DEBUG_STREAM=1 dumps SSE frames --- src/tools/mod.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/tools/mod.rs') diff --git a/src/tools/mod.rs b/src/tools/mod.rs index a8851ab..060dd7b 100644 --- a/src/tools/mod.rs +++ b/src/tools/mod.rs @@ -24,6 +24,30 @@ pub fn approval(name: &str) -> Approval { } } +/// 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> { + let text = |key: &str| args.get(key).and_then(|value| value.as_str()).unwrap_or(""); + let required = |key: &str| { + if text(key).trim().is_empty() { + Err(format!("`{key}` is required and must not be empty")) + } else { + Ok(()) + } + }; + + match name { + "bash" => required("cmd"), + "read" | "write" => required("path"), + "edit" => { + required("path")?; + required("old") + } + "grep" | "glob" => required("pattern"), + _ => Ok(()), + } +} + /// Tools that execute immediately. pub fn run(name: &str, args: &Value, cancel: &std::sync::atomic::AtomicBool) -> Result { match name { -- cgit v1.2.3