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/agent.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/agent.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/agent.rs b/src/agent.rs index 4bf19ed..f0e1292 100644 --- a/src/agent.rs +++ b/src/agent.rs | |||
| @@ -342,8 +342,19 @@ fn execute( | |||
| 342 | cancel: &AtomicBool, | 342 | cancel: &AtomicBool, |
| 343 | step: usize, | 343 | step: usize, |
| 344 | ) -> ToolOutcome { | 344 | ) -> ToolOutcome { |
| 345 | let args: Value = serde_json::from_str(&call.arguments).unwrap_or_else(|_| json!({})); | 345 | let args: Value = match serde_json::from_str(&call.arguments) { |
| 346 | Ok(args) => args, | ||
| 347 | Err(error) => { | ||
| 348 | return ToolOutcome::Failed(format!( | ||
| 349 | "arguments were not valid JSON ({error}); issue the call again with the \ | ||
| 350 | complete arguments" | ||
| 351 | )) | ||
| 352 | } | ||
| 353 | }; | ||
| 346 | ui::tool_line(step, &call.name, &args); | 354 | ui::tool_line(step, &call.name, &args); |
| 355 | if let Err(error) = tools::validate(&call.name, &args) { | ||
| 356 | return ToolOutcome::Failed(format!("{error}; the call was not run")); | ||
| 357 | } | ||
| 347 | 358 | ||
| 348 | match tools::approval(&call.name) { | 359 | match tools::approval(&call.name) { |
| 349 | Approval::Never => match tools::run(&call.name, &args, cancel) { | 360 | Approval::Never => match tools::run(&call.name, &args, cancel) { |
