GeezerVison is showing github.com — fix(acp): a blank line from an ACP agent no longer ends the session by only21mil · Pull Request #28851 · pingdotgg/t3code
Conversation
only21mil
commented
Nov 1, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Problem
If an ACP agent writes an empty or whitespace-only line to stdout, T3 Code ends the whole session with AcpProtocolParseError. The strict ACP frame parser hands every line to JSON.parse, and JSON.parse("") throws. A stray \n after a message, or a blank \r\n line, is enough to kill a running turn.
Change
makeStrictNdJsonRpcParser now skips lines that are empty after trim(). Every other line still goes through the strict JSON-RPC codec, so a malformed nonblank frame still ends the session, as before. The official ACP SDKs and T3 Code's own Codex app-server parser already skip these lines.
Scope
Bug fix: a crash of the agent session. This is a very small fix for an obvious bug, so it needs no prior issue: one condition in the frame loop, plus one test. It does not touch the stricter rule this parser exists for, which ends the session on malformed agent output. A line with no content is not a message, and the ACP reference SDKs ignore it.
Verification
To see it on Linux web: 1. add a Local ACP command whose stdout gets a blank line after a message (here a relay in front of a real agent); 2. open Settings, Providers, or start a turn with it; 3. on main the session ends with AcpProtocolParseError.
Revisions, in run order: main eceeab4d5c (newest main with a green push run), this head 9ea5e16389, and the head merged locally with main (1007038806, not pushed).
A real agent (Codex ACP) ran behind a stdio relay that adds \n, \r\n and \t\n lines after each frame and changes nothing else. The new test fails with main's parser and passes on the head and the merge.
Re-checked against main f419698 on 2026-11-12: the new test fails on that main without the change and passes with it, and the branch merges cleanly.
Before, main eceeab4d5c: the provider check fails on the first inserted line, so Codex ACP can't be picked.

After, head 9ea5e16389: a turn reads README.md and a follow-up completes.

Running session, inserted lines switched on after the first turn: main eceeab4d5c fails the follow-up with AcpProtocolParseError; head 9ea5e16389 completes it.


Not checked:
- iOS and Android: the fix is server-only, so this PR carries no phone captures.
- An agent that writes blank lines by itself, without the relay.
@agentclientprotocol/codex-acp 2.6.0, the package npm now points to; only 0.16.0 ran.
Method, more captures and transcripts
The official ACP SDKs ignore these lines: the TypeScript SDK's ndJsonStream and the Python SDK's stdio transport both trim each line and skip it if nothing is left. T3 Code's own Codex app-server parser also skips blank lines (effect-codex-app-server/src/protocol.ts).
- New test
skips blank lines between agent messages: fails with main's parser at eceeab4d5c (expected 'AcpProtocolParseError' to equal 'SessionUpdate'). On 9ea5e16389 and 1007038806, src/protocol.test.ts passes 30/30, the malformed-frame tests included.
- Real agent:
@zed-industries/codex-acp 0.16.0, the version I ran (npm marks it deprecated), on gpt-6-luna with a fresh config home and an API key through an API gateway. I added it as a Local ACP command behind blank-line-relay.ts, a stdio relay that passes every agent frame unchanged and writes \n, \r\n and \t\n after each one. That is the only change it makes, and it logs the counts. One dev server named "Test machine" per revision. Input was sent through the debugging port: Playwright with headless Chromium for web, and the same for the Linux desktop app (vp run dev:desktop under Xvfb).
Head 9ea5e16389, the turn:

Merged 1007038806: the same.

Linux desktop, main eceeab4d5c then head 9ea5e16389:


Transcripts: main, head, merged, running session, desktop
Main eceeab4d5c:
$ trace-failures.sh main/.t3/run2
1 AcpRegistryProbe.probeConfiguration Failure AcpRegistryOperationError: The ACP agent could not create a test session. | [cause]: AcpProtocolParseError: ACP protocol operation 'decode-wire-message' failed. | [cause]: SyntaxError: Unexpected end of JSON input
$ cat relay-main2.log
relay agent exited (code none, signal SIGTERM): agent frames passed unchanged=1; inserted lines=3 ("\n"=1, "\r\n"=1, " \t\n"=1)
Head 9ea5e16389:
$ run-report.sh head/.t3 183d31ff
run 1 | codex_acp | completed | 2026-11-11T22:41:35.793Z | 2026-11-11T22:41:41.670Z
run 2 | codex_acp | completed | 2026-11-11T22:41:45.334Z | 2026-11-11T22:41:48.575Z
reply: Model metadata for `gpt-6-luna` not found. Defaulting to fallback metadata; this can degrade performance and cause issues.
tool Read: Read /mnt/sample-notes/README.md [completed]
reply: The meeting moved to Thursday. ACP_REAL_OK
reply: Model metadata for `gpt-6-luna` not found. Defaulting to fallback metadata; this can degrade performance and cause issues.The notes said to bring the blue folder. FOLLOWUP_OK
$ cat relay-head.log
relay running: agent frames passed unchanged=33; inserted lines=99 ("\n"=33, "\r\n"=33, " \t\n"=33)
Merged 1007038806:
$ run-report.sh <merged checkout>/.t3 a89237c9
run 1 | codex_acp | completed | 2026-11-11T22:44:23.517Z | 2026-11-11T22:44:29.391Z
run 2 | codex_acp | completed | 2026-11-11T22:44:32.965Z | 2026-11-11T22:44:36.421Z
reply: Model metadata for `gpt-6-luna` not found. Defaulting to fallback metadata; this can degrade performance and cause issues.
tool Read: Read /mnt/sample-notes/README.md [completed]
reply: The meeting moved to Thursday. ACP_REAL_OK
reply: Model metadata for `gpt-6-luna` not found. Defaulting to fallback metadata; this can degrade performance and cause issues.The notes said to bring the blue folder. FOLLOWUP_OK
$ prompt-events.sh <merged checkout>/.t3 a89237c9-47f5-4421-a103-58f436eb3316
2026-11-11T22:44:23.605Z initialize started
2026-11-11T22:44:23.696Z initialize succeeded
2026-11-11T22:44:23.696Z session/new started
2026-11-11T22:44:23.705Z session/new succeeded
2026-11-11T22:44:23.863Z session/prompt started
2026-11-11T22:44:29.361Z session/prompt succeeded
2026-11-11T22:44:33.010Z session/prompt started
2026-11-11T22:44:36.396Z session/prompt succeeded
$ cat relay-merged.log
relay running: agent frames passed unchanged=33; inserted lines=99 ("\n"=33, "\r\n"=33, " \t\n"=33)
$ trace-failures.sh <merged checkout>/.t3
2 AcpRegistryProbe.probeConfiguration Success
Main eceeab4d5c, inserted lines switched on between the turns:
$ run-report.sh <main checkout>/.t3/run3 4f55a491
run 1 | codex_acp | completed | 2026-11-11T22:50:16.082Z | 2026-11-11T22:50:22.209Z
run 2 | codex_acp | failed | 2026-11-11T22:50:42.021Z | 2026-11-11T22:50:42.094Z
reply: Model metadata for `gpt-6-luna` not found. Defaulting to fallback metadata; this can degrade performance and cause issues.
tool Read: Read /mnt/sample-notes/README.md [completed]
reply: The meeting moved to Thursday. ACP_REAL_OK
error: Provider error: Provider turn failed. [failed]
$ prompt-events.sh <main checkout>/.t3/run3 4f55a491-2438-4183-a77c-6b11cfdc7d39
2026-11-11T22:50:16.172Z initialize started
2026-11-11T22:50:16.269Z initialize succeeded
2026-11-11T22:50:16.269Z session/new started
2026-11-11T22:50:16.281Z session/new succeeded
2026-11-11T22:50:16.464Z session/prompt started
2026-11-11T22:50:22.171Z session/prompt succeeded
2026-11-11T22:50:42.065Z session/prompt started
2026-11-11T22:50:42.074Z session/prompt failed errorTag=AcpProtocolParseError
$ cat relay-main3.log
relay agent exited (code none, signal SIGTERM): agent frames passed unchanged=19; inserted lines=3 ("\n"=1, "\r\n"=1, " \t\n"=1)
Head 9ea5e16389, inserted lines switched on between the turns:
$ run-report.sh <head checkout>/.t3/run3 5f2e4cd0
run 1 | codex_acp | completed | 2026-11-11T22:53:18.572Z | 2026-11-11T22:53:24.592Z
run 2 | codex_acp | completed | 2026-11-11T22:53:43.400Z | 2026-11-11T22:53:47.422Z
reply: Model metadata for `gpt-6-luna` not found. Defaulting to fallback metadata; this can degrade performance and cause issues.
tool Read: Read /mnt/sample-notes/README.md [completed]
reply: The meeting moved to Thursday at 10:00. ACP_REAL_OK
reply: Model metadata for `gpt-6-luna` not found. Defaulting to fallback metadata; this can degrade performance and cause issues.The notes said to bring the blue folder. FOLLOWUP_OK
$ prompt-events.sh <head checkout>/.t3/run3 5f2e4cd0-f199-4118-9361-ae6dac7f31f4
2026-11-11T22:53:18.673Z initialize started
2026-11-11T22:53:18.842Z initialize succeeded
2026-11-11T22:53:18.842Z session/new started
2026-11-11T22:53:18.859Z session/new succeeded
2026-11-11T22:53:19.134Z session/prompt started
2026-11-11T22:53:24.555Z session/prompt succeeded
2026-11-11T22:53:43.464Z session/prompt started
2026-11-11T22:53:47.279Z session/prompt succeeded
$ cat relay-head3.log
relay running: agent frames passed unchanged=38; inserted lines=45 ("\n"=15, "\r\n"=15, " \t\n"=15)
Desktop, main eceeab4d5c:
$ cat relay-desk-main.log
relay agent exited (code none, signal SIGTERM): agent frames passed unchanged=1; inserted lines=3 ("\n"=1, "\r\n"=1, " \t\n"=1)
$ trace-failures.sh <main checkout>/.t3/desk
1 AcpRegistryProbe.probeConfiguration Failure AcpRegistryOperationError: The ACP agent could not create a test session. | [cause]: AcpProtocolParseError: ACP protocol operation 'decode-wire-message' failed. | [cause]: SyntaxError: Unexpected end of JSON input
Desktop, head 9ea5e16389:
$ run-report.sh <head checkout>/.t3/desk 81e4635e
run 1 | codex_acp | completed | 2026-11-11T22:59:03.653Z | 2026-11-11T22:59:09.863Z
run 2 | codex_acp | completed | 2026-11-11T22:59:16.012Z | 2026-11-11T22:59:18.449Z
reply: Model metadata for `gpt-6-luna` not found. Defaulting to fallback metadata; this can degrade performance and cause issues.I’ll check `README.md` and identify the meeting’s new day.
tool Read: Read /mnt/sample-notes/README.md [completed]
reply: The meeting moved to Thursday. ACP_REAL_OK
reply: Model metadata for `gpt-6-luna` not found. Defaulting to fallback metadata; this can degrade performance and cause issues.The notes said to bring the blue folder. FOLLOWUP_OK
$ prompt-events.sh <head checkout>/.t3/desk 81e4635e-6c61-447e-a4ec-577ff94cb9f1
2026-11-11T22:59:03.779Z initialize started
2026-11-11T22:59:03.876Z initialize succeeded
2026-11-11T22:59:03.876Z session/new started
2026-11-11T22:59:03.888Z session/new succeeded
2026-11-11T22:59:04.073Z session/prompt started
2026-11-11T22:59:09.834Z session/prompt succeeded
2026-11-11T22:59:16.056Z session/prompt started
2026-11-11T22:59:18.427Z session/prompt succeeded
$ cat relay-desk-head.log
relay running: agent frames passed unchanged=48; inserted lines=144 ("\n"=48, "\r\n"=48, " \t\n"=48)
$ trace-failures.sh <head checkout>/.t3/desk
2 AcpRegistryProbe.probeConfiguration Success
Prior PRs
Generated with Claude Opus 5.5 and GPT-6.1 Terra and GPT-6.1 Sol in T3 Code Nightly
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at a51c31b
Macroscope's review found this PR approvable — Blank or whitespace-only ACP output lines are now ignored instead of ending the session. Nonblank messages retain strict decoding, keeping the change narrowly limited to transport tolerance.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 1, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The strict NDJSON parser now skips whitespace-only lines before decoding. Nonblank lines continue through strict JSON-RPC decoding. A regression test checks a valid session/update message surrounded by blank lines.
Changes: NDJSON Parser
| Layer / File(s) |
Summary |
Blank-line handling and validation packages/effect-acp/src/protocol.ts, packages/effect-acp/src/protocol.test.ts |
The parser skips lines with empty trimmed content. The test checks that blank lines around a valid session/update message do not prevent emission of a SessionUpdate event. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge
Merge Risk: Minimal · up to 82acd
-
This fix stops blank lines from an ACP agent from ending the session. It is low impact, malformed nonblank frames still fail, and it is covered by a regression test, so it looks ready to merge.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the fix and its effect: a blank line from an ACP agent no longer ends the session. The change makes makeStrictNdJsonRpcParser skip whitespace-only frames, which matches this. The title… |
| Description check |
 |
The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each contains specific content. The Problem section explains the crash and its trigger. T… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the fix and its effect: a blank line from an ACP agent no longer ends the session. The change makes makeStrictNdJsonRpcParser skip whitespace-only frames, which matches this. The title uses a conventional commit prefix, is one sentence, and is specific enough for a reader scanning history.
Full details: Description check
-
Explanation
The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each contains specific content. The Problem section explains the crash and its trigger. The Change section explains the one-condition fix and why nonblank malformed frames still fail. The Scope section explains why no prior issue is linked. Verification gives focused test results and real-agent runs, and it lists what was not checked. The description also cites prior PRs and includes the required model and harness attribution. The description is long and has more detail than the template asks for. The Scope section does not link an issue, but it gives the reason, which the template allows for small obvious fixes. The Verification section relies on screenshot links and transcripts, which the template accepts.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 9ea5e16 and 82acd03.
Files selected for processing: 1
-
packages/effect-acp/src/protocol.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 2, 2026
Note 🤖 Opus 5.5 replying on behalf of Victor.
I merged main into this branch in 9ea5e16 to clear the conflict in packages/effect-acp/src/protocol.ts. The blank-line check now sits inside main's linear-time frame loop. Main's end() already skipped a blank final line. This branch skips blank and whitespace-only lines mid-stream too, and every nonblank line still goes through the strict codec. The new protocol test still fails with main's parser and passes on this head.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
maria-rcks
commented
Nov 10, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Note Written by gpt-6.1-sol on behalf of Maria
Verified in a real dev environment
verified head 9ea5e16389a29c04dbc88db2e9e122d5a12f4a8e against github/main at d756fed7aa on linux, using the repo's playwright and /usr/bin/google-chrome. each checkout ran vp i and a background dev server; main stopped before the pr server started.
i added a real git project and local acp provider through the app. the provider ran the real codex acp adapter 0.16.0 with gpt-6.1-sol through the vm's codex proxy. a transport relay preserved actual acp frames and inserted empty, crlf, and space/tab-only lines between them. no mock responses or replay data were used.
- main: submitting a file-read prompt failed to open the provider session. the server reported
AcpProtocolParseError caused by Unexpected end of JSON input.
- pr: the same project, thread, provider, model and prompt completed with blank lines still enabled. codex read the real
README.md with a tool and returned its contents plus ACP_REAL_OK.
- a follow-up retained the previous turn's context with blank lines enabled.
- a nonblank
not-json line still failed the real provider session with AcpProtocolParseError. removing the injected output allowed another file-read turn to complete.
- the project stayed clean. all 30 protocol tests passed through blacksmith. git.cafe reported 31 successful checks, zero pending and zero failing on this head. no source changes or pushes were needed.
command transcript
main: provider session fails on blank lines.

pr: the same prompt completes. the earlier main failure remains visible in the thread history.


Not verified
native desktop, ios/android, macos/windows, remote relay/tunnel connections, and other acp agents were not exercised on this linux vm. blank lines were inserted around real provider output; natural blank-line emission by an unwrapped agent was not established. the adapter reported a model-metadata fallback warning for gpt-6.1-sol, but the real turns completed.
|
only21mil reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Evidence
Steps: Refresh the local ACP replay provider with blank-line injection ON; disable injection and refresh as a control; complete a control turn, enable blank-line injection, and send a follow-up in the same thread. On head, additionally send a turn with malformed nonblank output.
Environment on both sides: real web client and server, Chromium 1280×800, light theme, fresh isolated databases, synthetic project and recorded ACP replies. Local launch configuration fields are masked. The fixture delays its first frame by two seconds to make background discovery observable.
Head also rejects malformed nonblank frames:

Scenario, ACP stdout injector, Reproduction launcher.
Not shown:
- The original external ACP relay and live model package.json reply were replaced by deterministic ACP replay messages.
- Malformed nonblank rejection was checked on head only; the base scenario stops at the reproduced blank-line follow-up failure.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XS
0-9 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|