Repository navigation
fix(codex): the bridge doesn't re-register a dead thread (MUS-108) - #191
Merged
Merged
Conversation
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>
# Conflicts: # docs/roadmap.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_registrationsdeliberately keeps them, andmissing_registrationsdidn't check whether the bridge could still reach them. So once a dead thread's row left the roster, it was registered again everyREREGISTER_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
registeredwhen a connection ends. Muster already tracks MUS-77's wakeable set: the app-server is up, and the reconnect'sthread/listshowed the thread. Somissing_registrationsnow takesregistered.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_againwakeable_needs_the_app_server_up_and_the_thread_listedThe 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