Reconnect Codex tmux proxy after app-server drops#54
Merged
axeldelafosse merged 5 commits intomainfrom Mar 31, 2026
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces automatic reconnection logic for the CodexTmuxProxy, featuring exponential backoff, a formal initialization handshake, and updated health check endpoints. These changes ensure that the proxy can recover from upstream disconnects without dropping existing TUI socket connections. Feedback was provided to improve the clarity of the error message returned while the proxy is attempting to reconnect to the app-server.
Comment on lines
+595
to
+602
| if (!this.upstream) { | ||
| this.forwardToTui( | ||
| JSON.stringify( | ||
| proxyErrorFrame(frame.id, "codex app-server is reconnecting") | ||
| ) | ||
| ); | ||
| return; | ||
| } |
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.
Summary
Root cause
In paired tmux mode, tmux handoff releases the local Codex app-server handles. That leaves the tmux proxy as the only remaining supervisor for the Codex-side connection. The proxy previously treated any upstream websocket close as terminal and stopped immediately, which dropped the Codex TUI remote socket and left only a dead pane via
remain-on-exit.User impact
Paired tmux sessions no longer fail fast on a live app-server websocket drop. The proxy retries the upstream connection instead of immediately tearing down the TUI-side socket.
Validation
bun testbun run fixbun run check