Skip to content

fix(launcher): inherit HCOM_NOTES in the Codex bootstrap path#84

Merged
aannoo merged 3 commits into
aannoo:mainfrom
zane668:pr/codex-notes-bootstrap
Jul 21, 2026
Merged

fix(launcher): inherit HCOM_NOTES in the Codex bootstrap path#84
aannoo merged 3 commits into
aannoo:mainfrom
zane668:pr/codex-notes-bootstrap

Conversation

@zane668

@zane668 zane668 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Problem

The Codex-specific launch path hard-coded the bootstrap notes argument to an empty string, so a newly launched Codex session never received the global behavior notes (HCOM_NOTES) that every other tool's launch path passes through. Sessions started via other tools read HCOM_NOTES and include a NOTES section in their bootstrap; Codex was the lone exception and started without it.

Fix

Extract a build_codex_bootstrap helper that reads HCOM_NOTES from the effective launch environment and feeds it to the shared bootstrap::get_bootstrap used by both production and tests. Behavior is unchanged when HCOM_NOTES is unset — this only fills the gap where Codex diverged from the other tools.

Tests

Adds a unit test covering both cases: the NOTES section is present when HCOM_NOTES has a value, and behavior is unchanged when it is absent.

Verified locally with cargo fmt --all -- --check, cargo clippy --all-targets --locked -- -D warnings, and cargo test --locked (all green).

Only src/launcher.rs is touched.

🤖 Generated with Claude Code

The Codex-specific launch path hard-coded the bootstrap `notes` argument to an
empty string, so a newly launched Codex session never received the global
behavior notes that every other tool's launch path passes through. Sessions
started via other tools read HCOM_NOTES and include a NOTES section; Codex was
the lone exception and started without it.

Extract a `build_codex_bootstrap` helper that reads HCOM_NOTES from the
effective launch environment and feeds it to the shared `bootstrap::get_bootstrap`
used by both production and tests. Behavior is unchanged when HCOM_NOTES is
unset.

Adds a unit test covering both cases: the NOTES section is present when
HCOM_NOTES has a value, and behavior is unchanged when it is absent.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Session: 1422c55e-ec89-44cf-ad66-5e5538a19fb9
Producer: ai-session
Tool: cc
aannoo added 2 commits July 21, 2026 07:56
…sport

The existing tests only assert on build_codex_bootstrap's intermediate
string. Add a test that runs the real chain through preprocess_codex_args,
locates the -c developer_instructions= argument, TOML-decodes it, and
asserts multiline notes with quotes, backslashes, and literal braces
survive. Also add the HCOM_NOTES="" empty-value case, which is the
documented way to clear notes and is distinct from a missing key.
@aannoo
aannoo merged commit ecc8e81 into aannoo:main Jul 21, 2026
18 checks passed
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.

2 participants