Repository navigation
fix(bin): retire the status companion once its pane stops running Codex - #267
Merged
Merged
Conversation
…-bar test coverage
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.
Intent
"Can we run a builder to remove the bottom gpt-6-astra bar? We don't need that anymore. It's just taking up screen real estate."
Context: the primary Firstmate session in herdr pane wS:p1 was earlier launched as an Astra (gpt-6-astra) primary, which split off a status companion pane running
bin/fm-status-bar.sh --adapter codex --model gpt-6-astra --effort high --follow-pane wS:p1 --follow-backend herdr. The primary in that same pane is now Claude (Opus 5.5), but the companion kept running and kept showing the stale Astra bar below it, because it only exits when its followed pane is gone and the pane id was reused. Firstmate closed that pane by hand on 2026-10-02; the ask is that the bar does not come back.What Changed
bin/fm-status-bar.sh: a Codex status companion now exits when the pane it follows stops running Codex, not only when that pane closes. On tmux and herdr it looks for Codex in the pane's shell and up to five levels of child processes. On herdr the lookup starts fromshell_pid, so a Codex suspended with Ctrl-Z keeps its bar. Retirement only becomes possible after Codex has been seen at least once, and then Codex has to be missing for three refreshes in a row. A provider that can't report pane processes keeps the old pane-liveness behavior. Before exiting on herdr, the companion releases its zoom on the followed pane, but only if it owns that zoom.tests/fm-status-bar.test.shandtests/lib.sh: new cases for runtime-change retirement on both providers, a suspended Codex keeping its bar, and the zoom release applying only to a zoom the companion owns. The fake tmux now counts only pane-id lookups and refuses every other query, so the new process lookups don't use up a test's refresh count.docs/status-bar.md: documents the retirement rule, what counts as Codex behind the pane, the herdr measurement showing the provider closes the companion pane when it exits, the zoom release on retirement, and the extra test coverage.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The change is small and bounded. Retirement only applies to the codex adapter. It arms only after Codex has been positively seen behind the pane, and it needs three consecutive misses before it fires. A missing or failing process read cannot arm it, so the pre-existing pane-liveness behavior stays the fallback. I traced the intent's scenario: an Astra companion is launched by bin/fm-primary.sh, which execs codex, and Claude later takes over the same pane. After three misses the companion exits, and since it was exec'd as the companion pane's only process, the provider closes that pane. The suspended-Codex, unarmed-launch, and zoom-ownership paths behave as the user decided in earlier rounds.
Testing
I ran the targeted tests/fm-status-bar.test.sh, which passed. I then drove the real renderer, with production-shaped launcher arguments, against a real Codex and then a real Claude in two throwaway labs: a private fm-lab tmux socket and an fm-lab-* herdr 0.7.4 session. In both, the stale gpt-6-astra companion disappeared about 3–4 seconds after Codex was replaced by Claude in the same pane, and no Astra row was left. It never retired while Codex was running, while Codex was suspended with Ctrl-Z, or before Codex had started. On herdr the launcher's zoom was off after retirement. I can't show live that the renderer, rather than herdr itself, released that zoom: herdr clears a tab's zoom whenever a pane in that tab closes. The unit suite's herdr call log is the evidence for which component sends the release. Evidence is text captures of the terminal panes and process trees. No pixel screenshots were taken, because herdr's view helper needs pyte for a text render; the panes' own text reads show the user-visible row directly. Both labs were torn down and the worktree is clean.
pane zoom --offEvidence: Targeted status-bar test log
Source: Targeted status-bar test log
Evidence: tmux: companion before Codex starts (not armed, stays)
Source: tmux: companion before Codex starts (not armed, stays)
Evidence: tmux: real Codex running with Astra bar
Source: tmux: real Codex running with Astra bar
Evidence: tmux: Codex steady, bar kept
Source: tmux: Codex steady, bar kept
Evidence: tmux: Codex suspended (Ctrl-Z), bar kept
Source: tmux: Codex suspended (Ctrl-Z), bar kept
Evidence: tmux: Claude replaces Codex, companion retires at t+3s
Source: tmux: Claude replaces Codex, companion retires at t+3s
t+1s: %0:claude.exe %1:bash t+2s: %0:claude.exe %1:bash t+3s: %0:claude.exe ... %0 cmd=claude.exe h=30 lines containing gpt-6-astra: 0Evidence: herdr: companion before Codex, zoomed by launcher
Source: herdr: companion before Codex, zoomed by launcher
Evidence: herdr: real Codex running with Astra bar
Source: herdr: real Codex running with Astra bar
Evidence: herdr: Codex suspended (foreground = shell), bar kept
Source: herdr: Codex suspended (foreground = shell), bar kept
Evidence: herdr: Claude replaces Codex, companion retires at t+4s and zoom cleared
Source: herdr: Claude replaces Codex, companion retires at t+4s and zoom cleared
t+3s: panes=["w1:p1","w1:p2"] zoomed=true t+4s: panes=["w1:p1"] zoomed=false -- process-info w1:p1: fg=[node, claude.exe] w1:p1: 0 occurrences of gpt-6-astraPipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
pane zoom --offbash tests/fm-status-bar.test.sh(targeted status-bar suite including retirement, suspended-Codex and zoom-ownership cases) — exit 0tmux lab:bin/fm-lab-home.sh create $LAB,tmux -L fm-lab new-session -s primarywith FM_HOME=$LAB, companion split with the launcher's exact tmux command (exec env FM_HOME=… FM_PRIMARY_HARNESS=codex bin/fm-status-bar.sh --adapter codex --model gpt-6-astra --effort high --follow-pane %0 --follow-backend tmux) before Codex startedtmux lab: realcodexstarted in %0, waited 20s for steady state,send-keys C-zand waited 10s, thenkill -9 %1; wait; claudein the same pane, pollinglist-panesevery second;tmux kill-server+rm -rf $LABherdr lab:bin/fm-herdr-lab.sh name/provision,workspace create,pane split w1:p1 --direction down --ratio 0.93,pane zoom w1:p1 --on,pane run w1:p2with the launcher's herdr command plus--chrome-pane w1:p1 --chrome-zoomedand FM_STATUS_HERDR_SESSIONherdr lab: realcodexin w1:p1,pane send-keys w1:p1 ctrl+zwith an 11s hold (checked process-info foreground group = shell only, Codex state T), thenkill -9 %1; wait; claude, pollingpane listandpane layout .zoomedevery second;bin/fm-herdr-lab.sh teardown+rm -rf $LAB✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.