summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-06-12 14:49:51 -0600
committert <t@tjp.lol>2026-06-12 16:04:37 -0600
commitef4647f1d324cff43bb444ef4df6c253faed0d52 (patch)
tree9c5b131df15d86ed4b5473e3d1754466d0bbac63 /src
parentecadcfa7a1e549d6ddb8611bdf44cac852064cea (diff)
improve errors: retries, surfacing provider errors to the user
Diffstat (limited to 'src')
-rw-r--r--src/tui_app.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tui_app.zig b/src/tui_app.zig
index 4e9fee3..b7c297b 100644
--- a/src/tui_app.zig
+++ b/src/tui_app.zig
@@ -924,10 +924,14 @@ pub const App = struct {
_ = try self.spawnStatus("context overflow: compacting and retrying");
} else {
const secs = @as(f64, @floatFromInt(info.delay_ms)) / 1000.0;
+ // Prefer the provider's own diagnostic (e.g. an Anthropic
+ // `overloaded_error: ...`) over the bare error name, so
+ // the user sees *why* the turn stalled.
+ const reason = info.message orelse @errorName(info.err);
const msg = try std.fmt.allocPrint(
self.alloc,
"provider unavailable ({s}): retrying in {d:.1}s (attempt {d}/{d})",
- .{ @errorName(info.err), secs, info.attempt + 1, info.max_attempts },
+ .{ reason, secs, info.attempt + 1, info.max_attempts },
);
defer self.alloc.free(msg);
_ = try self.spawnStatus(msg);