From ef4647f1d324cff43bb444ef4df6c253faed0d52 Mon Sep 17 00:00:00 2001 From: t Date: Fri, 12 Jun 2026 14:49:51 -0600 Subject: improve errors: retries, surfacing provider errors to the user --- src/tui_app.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.3