Skip to content

fix(codex): the bridge doesn't re-register a dead thread (MUS-108) - #191

Merged
Castor-o7 merged 3 commits into
mainfrom
fix/mus-108-bridge-dead-threads
Nov 7, 2026
Merged

Castor-o7 merged 3 commits into
mainfrom
fix/mus-108-bridge-dead-threads

Conversation

@Castor-o7

Copy link
Copy Markdown
Owner

wise-leopard found this while porting MUS-76 to Marshal (MAR-7, Castor-o7/marshal#5 @ 330ae95).

Problem. The bridge keeps the threads it registered until thread/closed. Every tick it re-registers any whose session has left the roster (MUS-76). If the app-server connection ends (Codex crashes, or the app-server restarts), those threads never close. watch_app_server_registrations deliberately keeps them, and missing_registrations didn't check whether the bridge could still reach them. So once a dead thread's row left the roster, it was registered again every REREGISTER_COOLDOWN (5 s) for as long as the bridge lived. That's a ghost row, the same family as MUS-104 and MUS-105.

Change. Marshal empties registered when a connection ends. Muster already tracks MUS-77's wakeable set: the app-server is up, and the reconnect's thread/list showed the thread. So missing_registrations now takes registered.wakeable_sessions() and re-registers only those threads. A daemon restart without Postgres, MUS-76's case, leaves the app-server up and the threads listed, so they still come back. A thread the reconnect doesn't list stays registered, as MUS-77's test expects, but isn't registered again.

Tests.

  • a_thread_the_bridge_cant_wake_isnt_registered_again
  • wakeable_needs_the_app_server_up_and_the_thread_listed
  • The MUS-76 cooldown test, now passing the wakeable set.

The shim bridge tests (33) and clippy pass. The conformance suite's Codex restart cells cover MUS-76 end to end in CI.

🤖 Generated with Claude Code

Castor-o7 and others added 3 commits November 6, 2026 20:12
A registered thread whose app-server went away never gets thread/closed,
so the MUS-76 loop registered it again every 5 s as a ghost row. Only
threads the bridge can wake (app-server up, listed by the reconnect) are
registered again; a daemon restart leaves the app-server up, so MUS-76's
case still recovers. Found in Marshal's port (MAR-7) by wise-leopard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Castor-o7
Castor-o7 merged commit 4eacb8e into main Nov 7, 2026
6 checks passed
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