fix(codex): tolerate launcher stdout preambles - #7852
Conversation
There was a problem hiding this comment.
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
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Some CLI launchers write informational output to stdout before replacing themselves with
codex app-server. Omarchy 4.0's standardomarchy-mise-install codexwrapper does this viamise use -g codex, causing the provider probe to fail atdecode-wire-messageeven 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:
Verification:
vp test run packages/effect-codex-app-server/src/protocol.test.ts packages/effect-codex-app-server/src/client.test.tsvp run --filter effect-codex-app-server typecheckvp fmt --checkandvp lintImplemented with GPT-5.6 Sol in Codex.
Note
Add
ignoreNonJsonPreambletoCodexAppServerPatchedProtocoland default it on for child-process clientsignoreNonJsonPreambleonCodexAppServerPatchedProtocolOptionsandCodexAppServerClientOptions;client.makeChildProcessClientsets it totrueby default.makeCodexAppServerPatchedProtocol, non-JSON lines before the first decoded message are skipped and logged asignored_preamble; after the first message, non-JSON data still raises aCodexAppServerProtocolParseError.CODEX_APP_SERVER_TEST_STDOUT_PREAMBLE.ignoreNonJsonPreamble: falsetomakeChildProcessClientcan disable this.Macroscope summarized b28f67d. (Automatic summaries will resume when PR exits draft mode or review begins).