diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-18 12:34:33 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-18 12:34:33 +0100 |
| commit | 45d0d3c5f431688aa9dfbd6a4214256d6fe64122 (patch) | |
| tree | 862ca7949b0e6c1c8084f2fe7431bfa56364d8fc /src | |
| parent | 0.9.1: correctness fixes from the audit (diff) | |
| download | agent686-45d0d3c5f431688aa9dfbd6a4214256d6fe64122.tar.gz agent686-45d0d3c5f431688aa9dfbd6a4214256d6fe64122.zip | |
0.9.2: doc accuracy and UX fixes from the review
- missing key exits 1, consistent with --doctor
- HTML error bodies get a one-line message
- no unapprovable diff printed on a non-terminal
- weak GLIBC_2.39 fix covers x86_64 gnu as well as i686
- README/PLAN/CHANGELOG brought in line with the actual binary
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 3 | ||||
| -rw-r--r-- | src/provider.rs | 4 | ||||
| -rw-r--r-- | src/ui.rs | 4 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 0e5d49a..b17359b 100644 --- a/src/main.rs +++ b/src/main.rs | |||
| @@ -29,6 +29,7 @@ OPTIONS: | |||
| 29 | -m, --model <ID> model id (default: deepseek-v4.1-flash) | 29 | -m, --model <ID> model id (default: deepseek-v4.1-flash) |
| 30 | --base-url <URL> provider base URL | 30 | --base-url <URL> provider base URL |
| 31 | --session <ID> resume a session, creating it if the id is new | 31 | --session <ID> resume a session, creating it if the id is new |
| 32 | (alias: --resume) | ||
| 32 | -c, --continue resume the most recent session | 33 | -c, --continue resume the most recent session |
| 33 | --list list sessions and exit | 34 | --list list sessions and exit |
| 34 | --show [ID] print a transcript (most recent if no ID) and exit | 35 | --show [ID] print a transcript (most recent if no ID) and exit |
| @@ -220,7 +221,7 @@ fn run(args: Args) { | |||
| 220 | Ok(cfg) => cfg, | 221 | Ok(cfg) => cfg, |
| 221 | Err(message) => { | 222 | Err(message) => { |
| 222 | eprintln!("agent686: {message}"); | 223 | eprintln!("agent686: {message}"); |
| 223 | std::process::exit(2); | 224 | std::process::exit(1); |
| 224 | } | 225 | } |
| 225 | }; | 226 | }; |
| 226 | 227 | ||
diff --git a/src/provider.rs b/src/provider.rs index 0973e8c..b08d1f2 100644 --- a/src/provider.rs +++ b/src/provider.rs | |||
| @@ -484,6 +484,10 @@ fn accumulate_tool_call( | |||
| 484 | } | 484 | } |
| 485 | 485 | ||
| 486 | fn error_message(body: &str) -> String { | 486 | fn error_message(body: &str) -> String { |
| 487 | let trimmed = body.trim_start(); | ||
| 488 | if trimmed.starts_with('<') { | ||
| 489 | return "the provider returned an HTML error page rather than JSON".to_string(); | ||
| 490 | } | ||
| 487 | if let Ok(v) = serde_json::from_str::<Value>(body) { | 491 | if let Ok(v) = serde_json::from_str::<Value>(body) { |
| 488 | if let Some(err) = v.get("error") { | 492 | if let Some(err) = v.get("error") { |
| 489 | if let Some(message) = err.get("message").and_then(|m| m.as_str()) { | 493 | if let Some(message) = err.get("message").and_then(|m| m.as_str()) { |
| @@ -269,6 +269,10 @@ impl Approver { | |||
| 269 | if self.yolo || self.edits_allowed { | 269 | if self.yolo || self.edits_allowed { |
| 270 | return true; | 270 | return true; |
| 271 | } | 271 | } |
| 272 | // No point showing a diff that no one is present to approve. | ||
| 273 | if !self.interactive { | ||
| 274 | return false; | ||
| 275 | } | ||
| 272 | println!("{preview}"); | 276 | println!("{preview}"); |
| 273 | // The path is already on the tool line above. | 277 | // The path is already on the tool line above. |
| 274 | let _ = path; | 278 | let _ = path; |
