codex - 💡(How to fix) Fix Windows Codex Desktop: taskkill stdout is parsed as AppServerConnection JSON-RPC/MCP message

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Observed error: I exported a sanitized log excerpt with 147 matching parse-error lines. The errors are logged by AppServerConnection. Some taskkill PID chains end at the spawned codex.exe app-server PID.

  • buggy mode feeds taskkill stdout into a JSON line parser and reproduces the same parse error
  • fixed mode captures/isolates cleanup stdout and no parse error occurs
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

Codex Desktop 26.429.8261.0

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

On Windows Codex Desktop, I repeatedly see AppServerConnection parse failures where plain Windows taskkill output is parsed as a JSON-RPC/MCP message.

Observed error:

[AppServerConnection] Failed to parse MCP message Unexpected token 'S', "SUCCESS: T"... is not valid JSON linePreview="SUCCESS: The process with PID ... has been terminated."

On Chinese Windows locale, the same issue can appear as mojibake:

Unexpected token '�', "�ɹ�: ����ֹ"... is not valid JSON

I exported a sanitized log excerpt with 147 matching parse-error lines. The errors are logged by AppServerConnection. Some taskkill PID chains end at the spawned codex.exe app-server PID.

I also prepared a minimal Windows repro script:

  • buggy mode feeds taskkill stdout into a JSON line parser and reproduces the same parse error
  • fixed mode captures/isolates cleanup stdout and no parse error occurs

Direct probes of @playwright/mcp and npx/cmd wrapper did not reproduce non-JSON stdout on the MCP stdout channel, so the strongest current hypothesis is Codex Desktop / app-server host-side cleanup stdout pollution.

Codex日志导出-taskkill解析污染-脱敏版.md

What steps can reproduce the bug?

I do not have a single deterministic end-to-end Codex UI repro yet, but I have a deterministic minimal Windows mechanism repro that matches the observed Codex logs.

Observed in Codex Desktop:

  1. Run Codex Desktop on Windows with the app-server stdio transport.
  2. Use Browser Use / MCP-related functionality so Codex starts and later cleans up child processes.
  3. In Codex Desktop logs, AppServerConnection sometimes reports JSON parse failures where the line being parsed is plain Windows taskkill output.

Observed log pattern:

[AppServerConnection] Failed to parse MCP message Unexpected token 'S', "SUCCESS: T"... is not valid JSON linePreview="SUCCESS: The process with PID ... has been terminated." Minimal local repro:

cd <path-to-repro-folder> node .\probe-host-cleanup.js node .\probe-host-cleanup.js --fixed Expected output from buggy mode:

[host] Failed to parse MCP message [host] SyntaxError: Unexpected token ... [host] linePreview="SUCCESS: The process with PID ... has been terminated." [host] PASS: buggy host reproduced taskkill stdout parse pollution. Expected output from fixed mode:

[host] PASS: fixed host kept taskkill output out of the MCP parser. The repro demonstrates the mechanism: if Windows taskkill stdout is allowed to reach a stdio JSON-RPC/MCP line parser, it produces the same kind of Unexpected token parse failure seen in Codex Desktop logs.

I attached:

sanitized Codex Desktop log excerpt probe-host-cleanup.js minimal repro script

What is the expected behavior?

For stdio JSON-RPC/MCP transports, stdout consumed by the protocol parser should contain only JSON-RPC protocol messages.

Windows taskkill output, cleanup diagnostics, and other non-protocol text should be captured, redirected to stderr/log files, or otherwise isolated from the AppServerConnection JSON parser.

Codex Desktop should not attempt to parse lines like this as JSON:

SUCCESS: The process with PID ... has been terminated. Cleanup output should not cause:

Failed to parse MCP message Unexpected token 'S', "SUCCESS: T"... is not valid JSON

Additional information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Windows Codex Desktop: taskkill stdout is parsed as AppServerConnection JSON-RPC/MCP message