Skip to content

Handle stale broker sockets without metadata#17

Open
anchen1011 wants to merge 117 commits into
yiwenlu66:mainfrom
anchen1011:fix-stale-session-sidecar
Open

Handle stale broker sockets without metadata#17
anchen1011 wants to merge 117 commits into
yiwenlu66:mainfrom
anchen1011:fix-stale-session-sidecar

Conversation

@anchen1011

Copy link
Copy Markdown

Summary

  • ignore stale broker socket files that no longer have a metadata sidecar during session discovery
  • treat missing sidecars during session refresh as deleted sessions instead of surfacing a server error

Why

Codoxear can keep polling a remembered session after its broker socket metadata has been removed. Before this change, that stale state raised a server-side exception like missing metadata sidecar for socket ..., which could surface as a UI error even though the session was already gone.

Testing

  • restarted codoxear-server with the patch installed
  • verified a stale session request now returns 404 {"error":"unknown session"} instead of a 500
  • verified creating a new tmux-backed session still succeeds

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