Repository navigation
fix: retry unsubmitted steering doorbells - #10
Merged
Merged
Conversation
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.
Supersedes
Supersedes #8 and carries its commit ("Retry exact pending steering doorbells", rebased onto current main); PR 8 can be closed once this merges.
Review decisions
pendingcomposer is never typed into, ambiguous verdicts (pending-unproven,unknown) still ring by design, and the new Enter-only recovery resubmits only a recognized own doorbell.FM_BUSY_REGEXoverride for the Codex row) are deferred to follow-up inbox-busy-detection-redesign.docs/verification/runtime-backends.md; the live guard now defaults to Codex.Intent
Take on the problem that PR 8 identified. Take over development of this problem.
Context: PR 8 #8 (branch fm/stuck-input-doorbell-fix on this fork, targeting main) was opened directly, without no-mistakes, by another firstmate instance. The problem: a steered worker, seen five times in one day on Codex workers, sits idle with firstmate's steering doorbell line still unsubmitted in its input box, so the durable inbox message stays unhandled, stale alarms fire, and the operator has to press Enter by hand. Root cause per the PR:
fm_task_inbox_ringtyped the constant doorbell, tried Enter once and discarded the verdict; when the composer readpendingit skipped without checking whether the pending text was its own doorbell, and the watcher's re-ring ladder reused that path, so the stuck reminder was never resubmitted. The PR's fix recognizes only the exact doorbell text (or repeated copies), retries Enter with a small bounded budget without retyping, treats a pending Enter on a working pane as queued delivery throughfm_composer_queued_enter_verdict, defers the unread-instruction stale wake while working and raises it after retries are exhausted on an idle pane, and leaves foreign composer text untouched. Its own gaps, stated in the PR: Tab-to-queue was left out as unverified live, and live mid-turn recovery on Codex was not exercised, only portable tests. This home's own records add two observations. One: a Codex worker mid-turn shows the doorbell in its composer with "tab to queue message", and sending Tab queued it to run at turn end (verified 2026-09-30). Two: an idle Codex composer on Herdr kept the doorbell after failed rings until Enter was sent by hand (2026-10-03). The PR's required "PR must be raised via no-mistakes" check fails, and two Pi Calm behavior shards fail from unrelated Pi 1.0 test breakage that a separate task (fm-pi1-ci-compat) is fixing on main.What Changed
Risk Assessment
Testing
The focused inbox regression and all live Codex/Herdr checks passed. The terminal composer was evidenced through rendered pane text and live transcripts rather than a GUI screenshot. An explicit prepare-then-provision setup attempt hit the helper tripwire; using its provision path succeeded, and all lab sessions were torn down.
Evidence: Codex doorbell recovery on Herdr
Source: Codex doorbell recovery on Herdr
Evidence: Codex-only guard default on Herdr
Source: Codex-only guard default on Herdr
Evidence: Foreign composer draft preserved
Source: Foreign composer draft preserved
Evidence: Busy Enter claim prevents repeat
Source: Busy Enter claim prevents repeat
Evidence: Watcher defers stale wake while busy
Source: Watcher defers stale wake while busy
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-task-inbox-lib.sh:449- When the normal type-and-submit path returnsemptybecause Enter was accepted while the pane is busy, this returns before recording the per-message busy Enter claim. The doorbell can still be visible; the next busy watcher poll recognizes it and presses Enter again, potentially queueing the same steer twice. If the accepted-queued verdict leaves this record’s doorbell visible, preserve the busy result and claim it before returning. The same invariant applies atbin/fm-send.sh:1087(local steer),bin/fm-remote-secondmate-control.sh:291(remote steer),bin/fm-procevent.sh:806(process-event steer), andbin/fm-watch.sh:513(watcher retry).bin/fm-composer-lib.sh:1642- This comparison normalizes Unicode whitespace inside the doorbell payload. For a valid record under a path such as/tmp/run box/state, a draft that substitutes a non-breaking space in the quoted path is normalized to the expected ASCII space, recognized as Firstmate’s doorbell, and submitted with Enter; the worker then receives a different path. Preserve payload character distinctions and normalize only confirmed renderer padding. The conversion affects extracted content atbin/fm-composer-lib.sh:1597and the comparison input at:1648-1649.tests/fm-task-inbox-stuck-doorbell-live-e2e.test.sh:51- The live guard’s default matrix covers every listed harness on both backends, beyond the intent’s Codex recovery requirement. The changed runtime evidence records that this default coverage fails the idle-stuck case on OpenCode 1.18.33 and 1.18.34 (docs/verification/runtime-backends.md:825,838). Remove non-Codex harnesses from the default matrix; retain the environment override for explicitly requested broader runs.🔧 Fix applied.
3 warnings still open:
bin/fm-task-inbox-lib.sh:449- When the normal type-and-submit path returnsemptybecause Enter was accepted while the pane is busy, this returns before recording the per-message busy Enter claim. The doorbell can still be visible; the next busy watcher poll recognizes it and presses Enter again, potentially queueing the same steer twice. If the accepted-queued verdict leaves this record’s doorbell visible, preserve the busy result and claim it before returning. The same invariant applies atbin/fm-send.sh:1087(local steer),bin/fm-remote-secondmate-control.sh:291(remote steer),bin/fm-procevent.sh:806(process-event steer), andbin/fm-watch.sh:513(watcher retry).bin/fm-composer-lib.sh:1642- This comparison normalizes Unicode whitespace inside the doorbell payload. For a valid record under a path such as/tmp/run box/state, a draft that substitutes a non-breaking space in the quoted path is normalized to the expected ASCII space, recognized as Firstmate’s doorbell, and submitted with Enter; the worker then receives a different path. Preserve payload character distinctions and normalize only confirmed renderer padding. The conversion affects extracted content atbin/fm-composer-lib.sh:1597and the comparison input at:1648-1649.bin/fm-task-inbox-lib.sh:324- The earlier1bb4beafix round added this Codex-specific check but bypassed the documentedFM_BUSY_REGEXoverride (docs/configuration.md:1211). With a configured Codex busy pattern, the tmux submit core can accept Enter as queued while the doorbell remains visible, yet this branch returnsunknownand the latest F1 fix does not record the busy-Enter claim. On the next watcher poll, Codex's unverified semantic state and the same fallback can leave busy status unknown, so own-doorbell recovery may send Enter up to three times on a working pane. Honor the override while retaining the default active-row guard. The latest F1 claim and recovery paths that depend on this classification arebin/fm-task-inbox-lib.sh:428-431, :451, :462-465andbin/fm-watch.sh:489, :499, :513.🔧 **Test** - 2 issues found → auto-fixed → no changes applied ✅
bin/fm-composer-lib.sh:1667- Live Codex 0.160.0 on Herdr left this inbox's doorbell visible in the composer, but the rendered wrap dropped a separator space. The own-doorbell recognizer returned false, so the idle retry path treated the message as foreign and left the inbox record unhandled. The exact row comparison returns false at the mismatch here; this conflicts with the accepted renderer-whitespace behavior.TMPDIR="$PWD/.test-tmp" bash tests/fm-task-inbox.test.shFM_STUCK_DOORBELL_LIVE=1 FM_STUCK_DOORBELL_LIVE_BACKENDS=herdr FM_STUCK_DOORBELL_LIVE_HARNESSES=codex bash tests/.fm-task-inbox-stuck-doorbell-short.test.shusing a disposable workspace-local scratch rootTMPDIR="$PWD/.live-tmp" FM_HERDR_LAB_STATE_DIR="$PWD/.live-tmp/herdr-lab-state" CODEX_HOME="$PWD/.live-codex-home" bash .live-tmp/foreign-composer-e2e.shTMPDIR="$PWD/.live-tmp" FM_HERDR_LAB_STATE_DIR="$PWD/.live-tmp/herdr-lab-state" CODEX_HOME="$PWD/.live-codex-home" bash .live-tmp/midturn-composer-e2e.shCaptured live Herdr pane output for the stuck-doorbell, mid-turn, and foreign-draft scenarios.bin/fm-herdr-lab.sh run fm-lab-final-check session list🔧 No changes applied.
2 errors still open:
bin/fm-composer-lib.sh:1667- The live Codex 0.160.0 run on Herdr failed all three recovery phases. The idle-send phase left the doorbell visible and unhandled after repeatedrc=1retries; idle-stuck did not recognize the doorbell as its own; and mid-turn remained unhandled after the 51-second tool call completed. The live composer showed the wrapped doorbell text, but the own-doorbell matcher rejected it at this comparison, reproducing the reported stuck-inbox behavior.CODEX_HOME, but Codex never reached a classified empty composer within 90 seconds (state=unknown), so no foreign draft was entered. Using the…FM_STUCK_DOORBELL_LIVE=1 FM_STUCK_DOORBELL_LIVE_HARNESSES=codex FM_STUCK_DOORBELL_LIVE_BACKENDS=herdr FM_STUCK_DOORBELL_LIVE_TIMEOUT=240 bash tests/fm-task-inbox-stuck-doorbell-live-e2e.test.shProvisioned and tore down a named Herdr lab for the foreign-composer check using a temporaryCODEX_HOME; the composer readiness check remained unknown.🔧 Fix applied.
✅ Re-checked - no issues remain.
FM_STUCK_DOORBELL_LIVE=1 FM_STUCK_DOORBELL_LIVE_BACKENDS=herdr FM_STUCK_DOORBELL_LIVE_HARNESSES=codex FM_STUCK_DOORBELL_LIVE_TIMEOUT=240 bash tests/fm-task-inbox-stuck-doorbell-live-e2e.test.shenv -u FM_STUCK_DOORBELL_LIVE_HARNESSES FM_STUCK_DOORBELL_LIVE=1 FM_STUCK_DOORBELL_LIVE_BACKENDS=herdr FM_STUCK_DOORBELL_LIVE_TIMEOUT=240 bash tests/fm-task-inbox-stuck-doorbell-live-e2e.test.shbash bin/fm-test-run.sh tests/fm-task-inbox.test.shDrovefm_task_inbox_ringagainst real Codex composers for foreign-draft protection and repeated busy-poll claims.Drove the productioninbox_steer_checkagainst a working and then idle Codex/Herdr task; checked the persisted retry ladder and stale-wake queue.docs/verification/runtime-backends.md:851- OpenCode 1.18.33+ still fails to recognize its idle-stuck doorbell on tmux and Herdr; the documented follow-up remains open.✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.