Skip to content

Handle disconnected HTTP clients quietly#19

Open
Dominic789654 wants to merge 119 commits into
yiwenlu66:mainfrom
Dominic789654:fix/quiet-http-client-disconnects
Open

Handle disconnected HTTP clients quietly#19
Dominic789654 wants to merge 119 commits into
yiwenlu66:mainfrom
Dominic789654:fix/quiet-http-client-disconnects

Conversation

@Dominic789654

Copy link
Copy Markdown

Summary

  • ignore broken-pipe and related disconnect errors when a browser closes an HTTP request early
  • avoid cascading into a second 500 write on an already-closed socket
  • add a regression test covering both direct disconnects and disconnects during error responses

Testing

  • python3 -m unittest tests.test_server_disconnects

san-tian and others added 30 commits March 5, 2026 13:22
* Backend: file history, broker busy fix, resume helper

* tests: init SessionManager aliases/files in helper

SessionManager now expects _aliases and _files; the __new__ test helper must set them.

---------

Co-authored-by: Yiwen Lu <mcfloundinho@gmail.com>
Rebased onto latest main to resolve conflicts.

Co-authored-by: Yiwen Lu <mcfloundinho@gmail.com>
When a server user_message matches the optimistic local echo bubble, we consume it and update the pending DOM node. Ensure the acknowledged user event is still recorded in the local cache and duplicate filter so reloads do not drop recent user prompts.
Invalidate v2 caches that could omit recent user messages due to pending-ack consumption in earlier builds.
Prevent duplicate chat events in init snapshots by deduplicating on (role, ts_ms, text) when seeding and incrementally appending.
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.

4 participants