Chat progress recovery

The dispatcher persists ordered thinking, text and tool blocks on the owning assistant placeholder while generation continues. Session loading reads the same blocks as completed turns. Errors retain those blocks and display an additional error notice.

Scope and data flow

The stream tap accepts only the owning session and message identity. Nested runtime events retain their existing storage. Text deltas coalesce within adjacent blocks; tool results update their matching block. Existing final persistence remains authoritative on success. Error metadata merges with stored progress. No provider reasoning is generated or exposed beyond the thinking events already displayed live.

Reference and choices

The repository streaming-resume design, dispatcher stream tap, session node writer and assistant bubble define the contract. Reuse extra.blocks and the existing session load path; do not add browser-only storage or replay a truncated event buffer. External frameworks are not dependencies of this repair.

Acceptance

Through process_user_turn, reload persisted progress before returning from the provider loop and after a provider failure. Preserve text/thinking/tool order and exclude child events. Render the AssistantBubble with a failed status and verify both prior progress and the failure notice. Existing successful, cancelled and approval behavior remains compatible.

Retry visibility

Every automatic continuation or provider retry emits a correlated stream event with the attempt, limit, reason and delay when known. The assistant bubble displays a retrying state while the same turn remains active, including when earlier text exists. A later successful response, terminal failure or cancellation clears the state. Retry events never create a second user turn or mark the existing turn complete.

Implementation status

Implemented. Independent specification and quality reviews pass. The affected Python suites pass with 255 tests and one skip; all 713 Web tests, 513 repository contracts, Web static checks and documentation link checks pass. Tests cover fresh-store recovery during generation, provider failure, continuation, cancellation, child identity isolation and error rendering.