Files
codex/codex-rs/tui
Eric Traut 054128c9d9 Fix TUI assistant messages interrupted by tool execution (#59700)
## Why

A tool can start before an assistant message finishes streaming. The TUI needs to incorporate the completed text without duplicating the reply or leaving Markdown split across interrupted fragments. Some streams also include initial text in `item/started` before sending deltas.

## What changed

- Display initial assistant text from `item/started`, avoiding duplicate starts for the same message.
- Track interrupted replies by turn and item ID, then replace their flushed fragments with the completed message at the reply's original position, preserving intervening tool order.
- Re-render the completed Markdown and update transcript views and scrollback.

## Testing

Extend streaming tests to cover initial text, resumed deltas, Markdown spanning a tool interruption, and matching live and replayed transcripts. Expand completion-repair cases to cover missing text and resumed fragments.

GitOrigin-RevId: 7f35e52d0bca2100baf722d7ef4922cd127bbc45
2026-11-05 16:56:05 +00:00
..