Skip to content

fix(ai): restore Web chat streaming on one SSE connection - #353

Merged
ice-black-tea merged 5 commits into
masterfrom
fix/ai-web-chat-stream
Nov 23, 2026
Merged

ice-black-tea merged 5 commits into
masterfrom
fix/ai-web-chat-stream

Conversation

@ice-black-tea

@ice-black-tea ice-black-tea commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

  • Chat has one session SSE for occupancy, tool progress, thinking and text. Individual execution diagnostics keep their existing endpoint and format. No new polling or cross-process text transport.
  • Named thinking / text frames carry the execution ID once and an optional stable part coordinate. Empty part starts retain their boundary; no-op appends are skipped. Signed resume IDs remain opaque and occur only in the SSE id field, not the JSON. No per-connection part registry.
  • Session release is authoritative even if an execution observer stalls. When needed, read exactly the affected turn, rather than reloading the full timeline.
  • The Web console guide documents the shape and readback rules for other hosts.

Verification

59 focused Web, client, and process/co-ordination tests passed, including all 20 DOM modes. The CI Ruff rule set and architecture gate passed locally. Real SQLite ASGI covers UTF-8/whitespace, before-completion delivery, and cursor resume; deterministic boundary tests cover empty start, truncation, and skipping empty no-ops. In the reported empty thinking-start example, the JSON body serializes from 405 to 86 bytes. The signed cursor line is unchanged.

Disconnect cleanup regression

Full CI on a96c160 hit the test timeout during session SSE disconnect. Reproduced the blocked producer locally: cancellation could arrive during storage cleanup and still leave it waiting to enqueue a completion marker after the consumer stopped. The stream now observes the producer task itself, prevents post-cancel writes, and joins retiring observers without cancelling them twice. The added deterministic ASGI test fails before this fix and passes after it; the real disconnect/reconnect test also passed 20 consecutive repetitions.

@ice-black-tea ice-black-tea changed the title fix(ai): restore Web chat streaming and avoid full-history refreshes fix(ai): restore Web chat streaming on one SSE connection Nov 23, 2026
@ice-black-tea
ice-black-tea marked this pull request as ready for review November 23, 2026 05:56
@ice-black-tea
ice-black-tea merged commit d3460eb into master Nov 23, 2026
29 checks passed
@ice-black-tea
ice-black-tea deleted the fix/ai-web-chat-stream branch November 23, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant