Repository navigation
fix: prevent oversized Codex launch briefs from exceeding argument limits - #35
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.
Intent
"Q1552 y" (Q1552, 2026-10-31): start a Codex-only batch now with a 25% Codex floor, using Codex allowance before its reset. This job (fleet issues https://github.com/peterOC26/fleet/issues/288 and https://github.com/peterOC26/fleet/issues/209, the same defect): fm-control relaunch appends every relaunch note to data//brief.md (record_note in bin/fm-control.sh); after many relaunches the launch brief passes 131072 bytes and the Codex launch, which passes the brief as one argument, fails with "Argument list too long" (seen 2026-10-01 at 134998 bytes and 2026-10-09 at 131 KB). Workaround so far: moving old notes by hand to data//brief-progress-archive.md.
What Changed
Risk Assessment
✅ Low: The change is small and only affects Codex launches over 64 KiB. It writes the pointer file atomically, leaves smaller briefs inline as before, keeps brief.md unchanged, and adds a regression test that runs the real launch. The test should fail with E2BIG without the fix. The one open point is whether the other harnesses should get the same fix.
Testing
The targeted regression file and three real Codex/tmux scenarios passed. CLI transcripts and model-written reports demonstrate preserved instructions and fresh checkpoints; direct oversized execution reproduced E2BIG. Disposable settings resolved folder trust without changing normal settings, and the lab was removed.
Evidence: Live validation evidence
Source: Live validation evidence
Evidence: Observed Codex prompts and model-written results
Source: Observed Codex prompts and model-written results
Evidence: Real relaunch transcript
Source: Real relaunch transcript
Evidence: Oversized inline argument reproduces E2BIG
Source: Oversized inline argument reproduces E2BIG
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-spawn.sh:6048- The new size guard only applies when HARNESS is codex. Eleven other launch templates hand the encoded brief to the agent CLI as a single argument in exactly the same way:"$(__OPINPUT__ encode launch-brief < __BRIEF__)". The samesq_briefvalue is substituted into all of them. They are opencode (bin/fm-spawn.sh:2446), pi (2453/2455), omp (2472), agy (2497), grok (2505), cursor (2518), gemini (2553), devin (2557), polytoken (2587), commandcode (2594) and muse (2626). record_note in bin/fm-control.sh adds to brief.md no matter which harness the task uses. So after enough relaunches, a task on any of these harnesses whose launch-brief.md goes past 128 KiB on Linux still fails with "Argument list too long". This is the failure from fleet issues Honor project base refs for FirstMate spawns kunchenguid/firstmate#288/docs: document Orca backend adapter contract kunchenguid/firstmate#209, just on a different harness. kimi and rovo already use a pointer, and claude uses the doorbell record. The intent only names the Codex launch, so applying the fix to all harnesses would widen the scope. The natural place to do it is the sharedsq_briefsubstitution, applied to every template that uses theencode launch-brief < __BRIEF__form. Confirm whether that wider fix is wanted here or as a follow-up.✅ **Test** - passed
✅ No issues found.
codex --versionandcodex login statusbash tests/fm-control-relaunch.test.shpython3 ~/.no-mistakes/evidence/01M691RDTZQKJTBP1EPEQSTMY0/live-codex.pyExecuted real Codex with the full 150575-byte encoded instructions and reproduced Linux E2BIG.Compared model-written reports with independent tokens, checked byte-preserved instruction prefixes, and confirmed disposable lab cleanup.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.