Skip to content

docs: rewrite README's Codex stdout-contract section and rebuild its "not yet known" list (#453) - #495

Merged
fdaviddpt merged 2 commits into
mainfrom
fix/453
Sep 1, 2026
Merged

fdaviddpt merged 2 commits into
mainfrom
fix/453

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

Closes #453.

README.md's Codex section described the host as working and said nothing about the UserPromptSubmit stdout contract that made every Codex prompt read as Failed until #451/#452 -- Codex's hook engine sniffs the first non-whitespace byte of a UserPromptSubmit handler's stdout, and a [/{ that then fails Codex's own JSON schema marks the whole run HookRunStatus::Failed regardless of exit code. The section's Not yet known/Still open line also predated that fix and framed the open questions from before it existed.

This is docs-only, no script files touched (two other lanes -- #481 on scripts/save-session.sh, #447 on the four scripts/*-hook.sh files -- own those concurrently):

  • Added a paragraph naming the Codex reports UserPromptSubmit as Failed once the hook actually produces output, because its stdout contract is not Claude Code's #451/fix: stop Codex reading UserPromptSubmit as Failed on every prompt (#451) #452 mechanism, how scripts/user-prompt-hook.sh now handles it (branches on CLAUDE_PROJECT_DIR, wraps the stamp in Codex's own JSON envelope on hosts where it is unset), and that scripts/session-start-hook.sh was checked against three store shapes and does not share the defect -- stated correctly as a claim about the first byte of stdout (matching what Codex's sniffer actually checks), not "every line", after a reviewer caught the stronger, false version of that claim in an earlier commit on this branch (scripts/session-start-hook.sh:1073 opens a line with [; the cited test only proves the first stdout byte across three shapes, never every line -- see tests/test_codex_upsubmit_stdout_451.py's own docstring). Corrected before this PR was written.
  • Rebuilt the "Not yet known" list: codex resume behaviour after a non-zero extraction count is still unknown, and everything in the Codex section is OBSERVED against codex-cli 0.150.1 specifically -- the CLAUDE_PROJECT_DIR-unset branch shared with Gemini CLI is REASONED, not verified against a live Gemini install.
  • Added changelog.d/453.changed.md.

Below-bar finding, recorded here rather than filed: the reviewer separately confirmed the #451/#452 mechanism description, the JSON-envelope code path, the Gemini-CLI framing, and the changelog fragment format all check out against the code as it stands -- no other findings.

Test plan

  • python3 .oss/assemble_changelog.py --check -- ok, 453.changed.md parses and is listed.
  • Full suite: pytest -q -- 1917 passed, 43 skipped, 0 failed (~9m24s, macOS/Python 3.13.15).
  • Read scripts/user-prompt-hook.sh's #451 stdout-shape block and tests/test_codex_upsubmit_stdout_451.py directly to confirm every claim added to the README against the code, not just against the issue text.

…ce (#451/#452) and rebuild its "not yet known" list (#453)

The Codex section previously said nothing about the UserPromptSubmit
stdout contract that made every Codex prompt read as Failed until
#451/#452, and its "not yet known" list still framed the open questions
from before that fix existed. Add a paragraph naming the mechanism (Codex
sniffs the first stdout byte and marks the run Failed on a bare `[`/`{`
that fails its own schema), record that session-start-hook.sh was checked
against three store shapes and does not share the defect, and rebuild the
list from what is actually still unknown today.

Co-Authored-By: Max <noreply>
… the first stdout byte

The Explore reviewer caught it: scripts/session-start-hook.sh has one line
that opens with `[` ("[already delivered ...]"), so "every line ... never
`{`/`[`" was false on its face. What the cited test actually proves is
narrower and still sufficient -- the first stdout byte, which is what
Codex's own sniffing checks -- because that bracket-opening line is always
preceded on the same run by an unconditional `=== LAST HANDOFF ===`
header. Corrected the claim and carried the test's own OBSERVED-not-proven
caveat into the README.

Co-Authored-By: Max <noreply>
@fdaviddpt
fdaviddpt merged commit 72790c0 into main Sep 1, 2026
13 checks passed
@fdaviddpt
fdaviddpt deleted the fix/453 branch September 1, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

README's Codex section does not mention the stdout contract, and its 'Not yet known' list predates knowing about it

1 participant