diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-15 18:00:12 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-15 18:00:12 +0100 |
| commit | 8ae5bd48cf233315b5f36a7a6b39002a5e77f74b (patch) | |
| tree | 71c9b71f90f3cc64544dd506041468ee9bcbcda1 /src/provider.rs | |
| parent | 0.6.2: resizing no longer duplicates the prompt (diff) | |
| download | agent686-8ae5bd48cf233315b5f36a7a6b39002a5e77f74b.tar.gz agent686-8ae5bd48cf233315b5f36a7a6b39002a5e77f74b.zip | |
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
Diffstat (limited to '')
| -rw-r--r-- | src/provider.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/provider.rs b/src/provider.rs index 1b9e220..0973e8c 100644 --- a/src/provider.rs +++ b/src/provider.rs | |||
| @@ -358,7 +358,17 @@ pub fn chat_with( | |||
| 358 | } | 358 | } |
| 359 | } | 359 | } |
| 360 | 360 | ||
| 361 | outcome.tool_calls = calls.into_values().collect(); | 361 | let before = calls.len(); |
| 362 | outcome.tool_calls = calls | ||
| 363 | .into_values() | ||
| 364 | // Some backends emit an empty placeholder alongside a real call; asking | ||
| 365 | // a human to approve a blank command is worse than dropping it. | ||
| 366 | .filter(|call| !(call.name.is_empty() && call.arguments.trim().is_empty())) | ||
| 367 | .collect(); | ||
| 368 | let dropped_calls = before - outcome.tool_calls.len(); | ||
| 369 | if dropped_calls > 0 { | ||
| 370 | eprintln!("agent686: ignored {dropped_calls} empty tool call(s)"); | ||
| 371 | } | ||
| 362 | if outcome.usage.as_ref().is_some_and(|u| u.is_null()) { | 372 | if outcome.usage.as_ref().is_some_and(|u| u.is_null()) { |
| 363 | outcome.usage = None; | 373 | outcome.usage = None; |
| 364 | } | 374 | } |
| @@ -393,6 +403,9 @@ fn handle_event( | |||
| 393 | if data.is_empty() { | 403 | if data.is_empty() { |
| 394 | return false; | 404 | return false; |
| 395 | } | 405 | } |
| 406 | if std::env::var_os("AGENT686_DEBUG_STREAM").is_some() { | ||
| 407 | eprintln!("sse: {}", truncate(data, 400)); | ||
| 408 | } | ||
| 396 | if data.trim() == "[DONE]" { | 409 | if data.trim() == "[DONE]" { |
| 397 | *completed = true; | 410 | *completed = true; |
| 398 | return true; | 411 | return true; |
