Preserve terminal turn errors in replayed history (#35524)

## Why

When rebuilding a thread from rollout events, errors embedded in turn completion
events were ignored. Failed retries could therefore be restored as completed
turns, causing warnings such as model-overload errors to disappear from the TUI
transcript.

## What changed

- Mark turns with terminal completion errors as failed and retain their message
  and structured error information.
- Apply late completion errors to their matching historical turn without
  interrupting the active turn.

## Testing

Added history-builder coverage for current and late completion errors, plus a
TUI replay snapshot covering repeated overload failures.

GitOrigin-RevId: 5c474baa0fd5c73368b444d79fb850cbd4c8023a
This commit is contained in:
Felipe Coury authored and copyberry committed 2026-07-26 22:15:29 +00:00
1 parent 5a3808b77d
commit 9ca6df68da
3 files changed
+242 -5

No files matched your search

@@ -0,0 +1,15 @@
---
source: tui/src/chatwidget/tests/history_replay.rs
expression: rendered
---
› The workspace also looks super confusing with its separator.
⚠ Selected model is at capacity. Please try a different model.
› The workspace also looks super confusing with its separator.
⚠ Selected model is at capacity. Please try a different model.