Skip to content

Split codex app-server stdout on newline only - #2913

Open
JanderV wants to merge 1 commit into
get-bb:mainfrom
JanderV:fix/codex-stdout-newline-only
Open

Split codex app-server stdout on newline only#2913
JanderV wants to merge 1 commit into
get-bb:mainfrom
JanderV:fix/codex-stdout-newline-only

Conversation

@JanderV

@JanderV JanderV commented Sep 2, 2026

Copy link
Copy Markdown

Problem

Resuming or forking a Codex thread fails with JSON-RPC request timed out: thread/resume when the thread history contains a raw U+2028 (LINE SEPARATOR) or U+2029, for example pasted email or WhatsApp text. Fresh threads work.

createCodexAppServerConnection reads the child's stdout with node:readline, which also treats U+2028/U+2029 as line breaks. Codex emits those characters unescaped inside JSON strings, so the thread/resume response (1.6 MB in my case) arrives as 17 unparseable fragments. The pending request never resolves and hits CHILD_REQUEST_TIMEOUT_MS.

Verified with BB_PROVIDER_BRIDGE_RECORD_DIR: codex answered in 0.3 s, the bridge reported the 60 s timeout.

Fix

Read stdout with a StringDecoder and split on \n only. Adds a regression test that spawns a fake server echoing a JSON line with a raw U+2028.

Tested on bb 0.41.0 / codex 0.152.1: with this change the affected thread resumes in about 1 s.

node:readline also breaks lines on U+2028 and U+2029. Codex emits those
characters unescaped inside JSON strings, so a thread/resume or thread/fork
response for a thread whose history contains them was split into unparseable
fragments. The pending request never resolved and failed with
"codex app-server did not answer thread/resume within 60000ms".

Read the child's stdout with a decoder and split on "\n" only.
@SawyerHood

Copy link
Copy Markdown
Collaborator

@slopcop check

@SawyerHood

Copy link
Copy Markdown
Collaborator

@slopcop check please

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