Repository navigation
Fix Codex agent status in remote SSH workspaces - #18792
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAdds a Unix Codex wrapper that injects session-specific hook settings for eligible launches. Generated hook commands include the active socket and terminal identifiers. The wrapper passes through ineligible launches and adds a Codex shim to pane processes. ChangesCodex session hooks
Priority: ⬇️ Low Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant CodexShim
participant CmuxTuiWrapper
participant Codex
participant HookHelper
participant JournalSocket
CodexShim->>CmuxTuiWrapper: invoke codex-wrapper
CmuxTuiWrapper->>Codex: exec with session hook settings
Codex->>HookHelper: invoke contextual event command
HookHelper->>JournalSocket: append event with terminal subject
Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change makes Codex status reporting work in remote workspaces by injecting per-launch hooks, and it passes through launches that should not be modified. I found no concrete merge-blocking risk in the supplied material. Trust-key compatibility with Codex 0.162 was not independently confirmed. 🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (24 passed)Full details: Docstring CoverageExplanation Docstring coverage is 45.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 40 functions across 5 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Merge receipt for |
812c971 fix: make local-tmux detached recovery reliable (manaflow-ai#18654) 592952f fix(cloud): isolate sidebar row hover targets (manaflow-ai#18693) aece34e fix: repair Cloud VM canary and Claude managed defaults (manaflow-ai#18982) 071dbed fix(ui): reduce workspace layout follow-up amplification (manaflow-ai#18879) ca14fdd fix(cloud): fence WireGuard activation preparation lifecycle (manaflow-ai#18672) cf5bbe8 Fix Codex agent status in remote SSH workspaces (manaflow-ai#18792) f7095c9 ⌘⌥F finds open agent sessions by what was said in them (manaflow-ai#18962)
Summary
Remote Codex sessions now report status in the cmux-tui terminal that launched them, including when Codex runs hooks through a shared app-server daemon.
ssh-tmuxmirror boundary.Testing
./scripts/verify-cmux-tui-hosted.sh --filter codex_wrapper_remote_hookspython3 scripts/verify-local.py: passed applicable checks./scripts/localize-changes: passed; no localization keys changedgit diff --check: passedIssues
Changelog
Impact map
cmux-tuiCodex wrapper and the existing agent hook installer.cmux sshremote journal status is covered;ssh-tmuxmirrors remain on tmux control transport and have no agent-status subscription.cmux notifycalls.Mergeability
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Changes how Codex is launched and which hook commands run, including per-session config/trust injection, but follows the established Claude wrapper pattern and scopes trust to cmux-generated session hooks only.
Overview
Fixes Codex agent status in remote SSH workspaces when Codex runs hooks through a shared app-server that no longer has the launching terminal’s
CMUX_TUI_*environment.Adds a Codex PATH shim and hidden
cmux-tui agent codex-wrapperentrypoint (mirroring the existing Claude wrapper). On real session launches (exec,resume,fork), the wrapper injects Codex session-cflags that enable hooks whose commands embed the socket, terminal id, and cmux-tui helper path directly—so journal events still route to the correct pane after the original shell is gone. It trusts only those generated hooks, disables installed cmux hook copies for that invocation (avoiding duplicates), and hoists root-level-c/--enable/--disableahead of subcommands so injected settings are not dropped. Management/help invocations and opt-out env vars pass through unchanged; pane startup prepends the shim directory onPATHwhen needed.agent_hook_installgainscodex_session_hook_settingsand contextual hook command builders;session_routeis exposed from the hook helper for the wrapper. Integration tests exercise multi-terminal routing under cleared/stale daemon env, trust scoping, and pass-through behavior; agent-hooks docs describe the Codex-without-install flow and thessh-tmuxmirror limitation.Reviewed by Cursor Bugbot for commit 48bf4b4. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Fixes Codex agent status reporting in the cmux-tui terminal that launched the session, including when Codex runs hooks through a shared app-server daemon.
cmux-tui agent codex-wrapper) that embeds the socket and terminal id in each generated hook command, so hooks keep reporting correctly even after the daemon outlives the launching shell.exec,resume, andforksessions; management and informational commands pass through unchanged, and session config flags are hoisted before the subcommand.ssh-tmuxmirrors are unaffected — they run on tmux control transport and have no agent-status subscription.CMUX_TUI_CODEX_HOOKS_DISABLED=1to skip injection.Related: #15473
Written for commit 48bf4b4. Summary will update on new commits.
Summary by CodeRabbit