fix(bin): accept Codex follow-up queue submissions - #15
Open
andrew-kim-techtorch wants to merge 2 commits into
Open
fix(bin): accept Codex follow-up queue submissions#15andrew-kim-techtorch wants to merge 2 commits into
andrew-kim-techtorch wants to merge 2 commits into
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.
Requirement: Steering a Codex crewmate that is mid tool-call must not produce a false
fm-send"text not submitted" error when the steer was actually delivered into Codex's follow-up queue.What changed
When Codex is busy in a tool call, a steer typed into its composer is accepted into the visible "Messages to be submitted after next tool call" queue, and Codex leaves the queued row sitting at the cursor. The tmux submit verifier read that lingering row as a still-pending composer, retried Enter up to the retry limit, and then returned
pending, whichfm-sendsurfaces as a false "Enter swallowed" error even though the message was delivered. This change teaches the verifier a second success signal:fm-sendsets an opt-inFM_TMUX_CODEX_QUEUE_VERIFY=1for meta-confirmed Codex targets only, the verifier snapshots the queue depth before Enter, and a queue that grew after Enter is accepted as the newqueuedverdict instead of retrying. Every other harness keeps the exact prior composer-cleared contract, so verification is never weakened for non-Codex crews.How it works
Given a Codex crewmate
fm-fix-loginrunning a tool call, firstmate steers it withbin/fm-send.sh fm-fix-login 'also update the tests'. Codex accepts the text into its follow-up queue, so the composer does not clear. The verifier counts↳rows under the queue heading before Enter (say 0) and after Enter (now 1); because1 > 0it returnsqueuedandfm-sendexits 0 with the steer delivered, instead of hammering Enter three more times and reporting a false failure. If instead the composer still held the text and the queue count had not moved, the verifier returnspendingandfm-sendstill reports the genuine swallow as an error, exactly as before.Evidence
Testing suite:
.no-mistakes.yamlcommands.test)Risks
Low and contained. Queue recognition is gated behind both
TARGET_HARNESS=codex(infm-send.sh) and the explicitFM_TMUX_CODEX_QUEUE_VERIFY=1opt-in, so no non-Codex path changes behavior. The queue count is derived from a best-efforttmux capture-pane; a capture failure is treated as inconclusive and falls back to the existing composer-cleared logic, never a false success. The stale-queue and genuine-swallow cases are covered by the regression suite above so a real swallow still fails closed.Links
Firstmate-internal change to
bin/fm-send.sh,bin/fm-tmux-lib.sh, and theharness-adaptersskill; no related PR or tracking issue.Pipeline
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.
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"Provided successful baseline: `command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"bash tests/fm-send-codex-verification.test.shbash tests/fm-send-popup-settle.test.shbash tests/fm-send-settle.test.shbash tests/fm-daemon.test.shRanbin/fm-send.sh fm-task 'fix verification'against a real tmux pane simulating Codex’s visible follow-up queue; verified exit 0, queue growth from 0 to 1, and exactly one Enter.Ran the samefm-sendflow against a metadata-confirmed Claude target; verified exit 1 and three Enter attempts, preserving the non-Codex pending-composer contract.Exercisedfm_tmux_submit_enter_core target 3 0 0with pane reads failing; verified verdictunknownremains non-error under fm-send policy.Verifiedgit status --shortremained clean at target commitea1a303a3a71fd93536ed511382ca2c8ee78ae8e.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.