Skip to content

fix(codex): tolerate launcher stdout preambles - #7852

Draft
KyleKincer wants to merge 2 commits into
pingdotgg:mainfrom
KyleKincer:fix/codex-stdout-preamble
Draft

fix(codex): tolerate launcher stdout preambles#7852
KyleKincer wants to merge 2 commits into
pingdotgg:mainfrom
KyleKincer:fix/codex-stdout-preamble

Conversation

@KyleKincer

@KyleKincer KyleKincer commented Aug 21, 2026

Copy link
Copy Markdown

Some CLI launchers write informational output to stdout before replacing themselves with codex app-server. Omarchy 4.0's standard omarchy-mise-install codex wrapper does this via mise use -g codex, causing the provider probe to fail at decode-wire-message even though Codex itself is current and functional.

This change lets child-process Codex clients ignore non-JSON lines only until the first valid JSON-RPC message is routed. Once protocol traffic begins, malformed stdout remains fatal. Ignored preamble diagnostics record only byte length rather than the launcher text.

Regression coverage verifies:

  • an Omarchy/mise-style preamble no longer prevents initialization;
  • child-process clients enable the behavior by default;
  • malformed stdout after protocol startup still fails strictly.

Verification:

  • vp test run packages/effect-codex-app-server/src/protocol.test.ts packages/effect-codex-app-server/src/client.test.ts
  • vp run --filter effect-codex-app-server typecheck
  • targeted vp fmt --check and vp lint

Implemented with GPT-5.6 Sol in Codex.

Note

Add ignoreNonJsonPreamble to CodexAppServerPatchedProtocol and default it on for child-process clients

  • Introduces optional ignoreNonJsonPreamble on CodexAppServerPatchedProtocolOptions and CodexAppServerClientOptions; client.makeChildProcessClient sets it to true by default.
  • In makeCodexAppServerPatchedProtocol, non-JSON lines before the first decoded message are skipped and logged as ignored_preamble; after the first message, non-JSON data still raises a CodexAppServerProtocolParseError.
  • Adds tests in protocol.test.ts and client.test.ts, plus a mock-peer fixture flag CODEX_APP_SERVER_TEST_STDOUT_PREAMBLE.
  • Behavioral Change: child-process clients now silently drop non-JSON stdout output emitted before the first protocol message; callers passing ignoreNonJsonPreamble: false to makeChildProcessClient can disable this.

Macroscope summarized b28f67d. (Automatic summaries will resume when PR exits draft mode or review begins).

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 21, 2026

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One convention finding: the new preamble handling uses Effect.catchTag, which the repo conventions replace with Effect.catchTags({ ... }) even for a single tag.

Posted via Macroscope — Effect Service Conventions

Comment thread packages/effect-codex-app-server/src/protocol.ts Outdated
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8760422c-53a7-4452-906d-bd7f77c33b8d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant