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/provider.rs | |
| 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 '')
| -rw-r--r-- | src/provider.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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()) { |
