fix: report agent status in ssh-tmux mirrors

Merged
AU
25d ago
+968-9

Summary

Codex and Claude status now appears in remote ssh-tmux mirrored workspaces. The mirror subscribes to the existing tmux control stream, installs pane-bound launch hooks, and projects pane state into workspace and sidebar lifecycle status. Codex launch hooks carry the pane route and trust context into shared app-server daemons, so later hook events still reach the originating terminal.

Root cause

Ordinary remote SSH Codex status already had a hook path, but ssh-tmux mirrors did not subscribe to pane status. Existing tmux shells could also predate mirror attachment, so changing only the tmux default command left those shells without the shim. Shared Codex daemons could lose the original terminal hook context. The fix addresses those transport boundaries while preserving the existing Claude wrapper behavior.

Implementation

  • Install hooks against a validated tmux session id or session-name fallback when the numeric id is not available yet.
  • Subscribe and fan out pane status through both dedicated and multiplexed remote tmux connections.
  • Install the shim into eligible existing idle shells without sending input to busy shells, continuation prompts, or unfinished commands.
  • Preserve custom tmux default-command values and normal bash/zsh login and interactive startup files.
  • Project pane status into panel and workspace entries with urgency-aware aggregation.
  • Keep Codex management/help invocations and explicit hook opt-outs unmodified.

Verification

  • python3 -m unittest scripts.tests.test_remote_tmux_agent_helper -v — 10 passed.
  • python3 scripts/verify-local.py --all — 16/16 passed.
  • python3 scripts/verify-local.py --only swift-syntax --swift-changed origin/main — 19 selected Swift files parsed.
  • ./scripts/sync-test-wiring --check — passed.
  • git diff --check — passed.
  • The exact pushed head is 9f3c1e2649f0e93382b0f823cecd1dc0931890dd; required hosted CI, macOS compile admission, changed-suite tests, TUI conformance, and CodeRabbit checks pass for this head.

Related

  • Ordinary cmux ssh Codex status: #18792.
  • Related upstream design: #6710.
  • Shared Codex daemon context: #15473.

Limitations

  • Agents already running before hook installation cannot gain launch-time hooks retroactively; restart them after moving to another terminal.
  • Existing-shell initialization is limited to recognizable idle prompts; pending input is left untouched.

Changelog

  • Fixed: agent status now updates in Claude and Codex ssh-tmux mirror workspaces, including shared Codex daemon launches.

Mergeability

  • Base SHA: 427a4a0636e1bf6e8c40c321bef393d39174b8c8.
  • Head SHA: 9f3c1e2649f0e93382b0f823cecd1dc0931890dd.
  • origin/main is an ancestor of the head through merge commit 9f3c1e2649f0e93382b0f823cecd1dc0931890dd; local git merge-tree --write-tree origin/main HEAD completed without conflicts.
  • This PR remains open and will not be merged by this task.