fix(composer): restore Pi Codex usage-limit banner detection across renderings - #16
Closed
mehulbhagwani wants to merge 5 commits into
Closed
mehulbhagwani wants to merge 5 commits into
mehulbhagwani wants to merge 5 commits into
Conversation
…or fm-control A Pi worker on Herdr that ended its turn on `Error: Codex error: The usage limit has been reached` could never be reclaimed: the separated composer shape required the identity probe to report idle or done, but Herdr learns Pi's status only from Pi's lifecycle integration, so a status that never followed the failed turn parked at `working` (or Herdr's `unknown` placeholder) and every lifecycle verb refused a provably empty composer. bin/fm-composer-lib.sh now reads that fixed banner, when it is the last non-blank row above a solid, empty Pi separator pair on a pane whose identity names a live Pi, as proof the turn ended, and answers `empty` on every registered status. A running Pi retitles its opening rule and dissolves the pair, a new prompt displaces the banner, and probe-absent, foreign, near-miss, and typed shapes keep refusing. Verified live on pi 0.85.1 against a stub Codex endpoint; the new live-harness-optin guard refreshes that evidence. Fixes kunchenguid#5000.
…ride in configuration.md
…ooks like a pi bug, /bug sends a report to the developers." hint row directly under every error banner, which now sits between the Codex usage-limit banner and pi's separator pair. bin/fm-composer-lib.sh's _fm_composer_pi_terminal_banner_above only inspected the single last non-blank row above the pair, so this new vendor boilerplate line made it miss the banner text and misclassify the composer as 'unknown' (surfaced by the live guard test tests/fm-composer-pi-codex-banner-live-e2e.test.sh, family live-harness-optin, which runs against the actually-installed pi). Fix: the scan now tolerates at most one occurrence of that fixed hint row between the banner and the pair (new FM_COMPOSER_PI_ERROR_HINT_RE_DEFAULT / FM_COMPOSER_PI_ERROR_HINT_RE override, matching the existing override pattern for the banner regex), then still requires the row beneath it to match the exact banner text. All existing strictness is untouched: a different provider's error, a near-miss spelling, a case change, a real transcript row, two hint rows in a row, or a running pi's retitled separator still refuse. Added a byte-fixture regression to tests/fm-composer-lib.test.sh covering the new hint-line shape (empty for every stale status) plus a negative case (two hints in a row still refuses). Verified locally: tests/fm-composer-lib.test.sh and tests/fm-control.test.sh pass in full, and the live guard tests/fm-composer-pi-codex-banner-live-e2e.test.sh passes against the locally installed pi 0.85.1 (which predates the hint line), confirming no regression on the older rendering. Did not fabricate or edit docs/verification/runtime-backends.md's pi 0.87.1 evidence entry since I could not run the live guard against that exact pi version locally
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
Bring the Codex-banner fix for kunchenguid/firstmate issue 5000 back, on the same PR: kunchenguid#5709 (not a new PR). The PR was closed because its branch had diverged from main. Kun's triage asked for: rebase onto current main so the PR contains only the composer/Codex-banner restore (the Pi Codex usage-limit banner detected as a settled composer across renderings, plus the pi 0.87.1 error-hint row tolerance) and its tests/docs, clear CONFLICTING, and re-raise through no-mistakes so the PR body attestation matches the head.
What Changed
bin/fm-composer-lib.sh's detection of Pi's Codex usage-limit banner as a settled composer, extending_fm_composer_pi_terminal_banner_aboveto tolerate at most one occurrence of pi 0.87.1's new fixed "If this looks like a pi bug..." hint row between the banner and pi's separator pair, via newFM_COMPOSER_PI_ERROR_HINT_RE_DEFAULT/FM_COMPOSER_PI_ERROR_HINT_REoverride (mirroring the existing banner-regex override pattern).tests/fm-composer-pi-codex-banner-live-e2e.test.sh(familylive-harness-optin) that runs against the actually-installedpi, wire it intobin/fm-test-run.sh, and add byte-fixture regression cases totests/fm-composer-lib.test.shandtests/fm-control.test.shcovering the new hint-line shape and negative cases (near-miss spelling, two hint rows in a row, running pi's retitled separator).FM_COMPOSER_PI_ERROR_HINT_REoverride indocs/configuration.mdanddocs/herdr-backend.md, and record verification evidence indocs/verification/runtime-backends.md.Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Risk Assessment
🚨 High: The rebase failed to isolate the Codex-banner fix as instructed: three unrelated, independently-authored commits (touching remote-job worker polling, wake/recovery logic, and Claude launch permissions) remain in the diff, directly contradicting the explicit, authoritative user intent that this PR contain only the composer/Codex-banner restore and its tests/docs.
Testing
All four previously-inconclusive scenarios were driven live to completion this run: the actually-installed pi 0.87.1 rendered the real Codex usage-limit banner plus its new bug-report hint row and was correctly classified as a settled/empty composer across statuses and read modes; the byte-fixture matrix (including the two-consecutive-hint adversarial boundary, which correctly stays refused) passed; and fm-control's settled-banner /quit-delivery behavior passed unaffected. Verdict: go.
Evidence: live pi 0.87.1 banner guard output
Evidence: fm-control settled-banner scenario
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-remote-job-worker.sh:1- User intent requires: 'rebase onto current main so the PR contains only the composer/Codex-banner restore ... and its tests/docs.' The branch range 8c5493a..4b94f24 still carries three unrelated, already-authored-by-others commits that are NOT ancestors of origin/main: 3d14792 ('fix: reduce remote worker and polling helper process churn (fix: reduce remote worker and polling helper process churn kunchenguid/firstmate#5889)', authored by Kun Chen), 90e88d7 ('fix(bin): prevent idle recovery loops without stranding wakes (fix(bin): prevent idle recovery loops without stranding wakes kunchenguid/firstmate#4819)', authored by Joseph Kim), and c19c240 ('fix: grant Claude workers access to Firstmate task channels (fix: grant Claude workers access to Firstmate task channels kunchenguid/firstmate#5884)', authored by Kun Chen). These pull in unrelated changes to bin/fm-remote-job-worker.sh, bin/fm-remote-job-lib.sh, bin/fm-wake-lib.sh, bin/fm-classify-lib.sh, bin/fm-spawn.sh, bin/fm-path-lib.sh, bin/fm-agent-process-lib.sh, bin/fm-branch-outcome.sh, bin/fm-contributions.sh, bin/fm-dod-lib.sh, bin/fm-inactive-reconcile.sh, bin/fm-lease-lib.sh, bin/fm-parent-channel-lib.sh, bin/fm-session-lock-lib.sh, bin/fm-teardown.sh, bin/fm-test-run.sh, bin/fm-tmux-lib.sh, bin/fm-wake-drain.sh, bin/fm-watch.sh, docs/watcher-continuity.md, docs/remote-secondmates.md, docs/scripts.md, and multiple test files, none of which are the composer/Codex-banner fix, its tests, or its docs. This is a smaller instance of the same class of problem flagged and declined in review round 1 (which involved ~90 unrelated commits on that earlier branch state) but is a materially different, newly reintroduced occurrence on this rebased branch, so it is being re-raised here.✅ **Test** - passed
✅ No issues found.
FM_COMPOSER_PI_BANNER_LIVE=1 bash tests/fm-composer-pi-codex-banner-live-e2e.test.shbash tests/fm-composer-lib.test.shbash tests/fm-control.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.