fix: response handling and terminal-safe TUI attach wrapper#6
Merged
raysonmeng merged 2 commits intomasterfrom Mar 24, 2026
Merged
fix: response handling and terminal-safe TUI attach wrapper#6raysonmeng merged 2 commits intomasterfrom
raysonmeng merged 2 commits intomasterfrom
Conversation
Bug investigation findings (with Codex cross-review):
1. Proxy response improvements:
- Support string response IDs in handleAppServerResponse (was
silently dropping non-numeric IDs)
- Log when response arrives but no TUI is connected (was silent)
2. Terminal corruption fix:
- Add scripts/agentbridge-attach.sh wrapper that saves terminal
state (stty -g) before launching Codex TUI and restores it on
exit, including raw mode, keyboard enhancement, bracketed paste,
focus tracking, and alternate screen cleanup
- Works even after kill -9 of the child process (wrapper survives)
3. Resume hang: confirmed as Codex upstream bug (GitHub #14470,
#12382, #12515), not a bridge proxy issue.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nces, trap signals
1. codex-adapter.ts: Replace permissive Number() coercion with /^-?\d+$/ regex
to prevent Number("") → 0 and Number("1.5") false matches
2. agentbridge-attach.sh: Write escape sequences to /dev/tty when available,
fall back to stdout only if it's a terminal
3. agentbridge-attach.sh: Trap INT and TERM in addition to EXIT for macOS
bash 3.2 compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
raysonmeng
pushed a commit
that referenced
this pull request
Mar 26, 2026
- Replace node with bun in package.json scripts and shebang (#1) - Fix init.md: init is best-effort plugin install, dev handles marketplace (#2) - Set executable permission on health-check.sh (#4) - Add squash merge rule to init.md collaboration template (#5) - Update plugin README to describe dual-mode transport (#6) Cross-reviewed: Claude ↔ Codex Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Bug investigation with Codex cross-review found 2 fixable issues + 1 upstream bug:
Files changed
src/codex-adapter.ts— numeric-string ID support in handleAppServerResponse, TUI-absent response loggingscripts/agentbridge-attach.sh— new wrapper that protects terminal from corruption after kill -9Test plan
Review
Codex reviewed 2 rounds, all findings addressed.
🤖 Generated with Claude Code + Codex