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 --- tests/mock.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests/mock.rs') diff --git a/tests/mock.rs b/tests/mock.rs index 9b9a56d..7e076e3 100644 --- a/tests/mock.rs +++ b/tests/mock.rs @@ -442,3 +442,28 @@ fn a_final_frame_without_a_newline_is_not_lost() { .expect("a trailing frame without a newline should still count"); assert_eq!(outcome.content, "last"); } + +#[test] +fn an_empty_placeholder_tool_call_is_dropped() { + const SSE: &str = concat!( + "HTTP/1.1 200 OK\r\n", + "Content-Type: text/event-stream\r\n", + "Connection: close\r\n", + "\r\n", + "data: {\"choices\":[{\"delta\":{\"tool_calls\":[{\"index\":0,\"id\":\"call_1\",\"function\":{\"name\":\"read\",\"arguments\":\"{\\\"path\\\":\\\"a\\\"}\"}},{\"index\":1}]},\"finish_reason\":\"tool_calls\"}]}\n\n", + "data: [DONE]\n\n", + ); + let (base, _rx) = serve_once(SSE); + let mut sink = Collector::default(); + let outcome = provider::chat( + &config(base), + &[json!({ "role": "user", "content": "hi" })], + &[], + &AtomicBool::new(false), + &mut sink, + ) + .expect("chat should succeed"); + + assert_eq!(outcome.tool_calls.len(), 1, "{:?}", outcome.tool_calls); + assert_eq!(outcome.tool_calls[0].name, "read"); +} -- cgit v1.2.3