Skip to content

Prefer local reads for .svelte files to avoid ACP stdio framing failures related to newlines#205

Closed
rkboyce wants to merge 3 commits intozed-industries:mainfrom
rkboyce:testing/addressing-security-issues
Closed

Prefer local reads for .svelte files to avoid ACP stdio framing failures related to newlines#205
rkboyce wants to merge 3 commits intozed-industries:mainfrom
rkboyce:testing/addressing-security-issues

Conversation

@rkboyce
Copy link
Copy Markdown
Contributor

@rkboyce rkboyce commented Mar 24, 2026

This works around a transport issue seen when reading some .svelte files via ACP fs/read_text_file. In the failing cases, raw Svelte content can leak outside the newline-delimited JSON-RPC envelope, causing parser failures and follow-on tool call errors. To keep patch flows stable, AcpFs now falls back to local filesystem reads for .svelte files while continuing to use ACP-backed reads for other file types.

Expected behavior:

When Codex reads a .svelte file through ACP fs/read_text_file, the client should return the file contents as a valid JSON-RPC response, with the Svelte source contained inside the JSON string. The ACP stream should remain synchronized, and patching should continue normally.

Actual behavior:

The ACP stream becomes desynchronized while reading a .svelte file. See
Uploading acp-codex-log-with-error.txt…

In acp-codex-log-with-error.txt:22235, the parser reports this instead of a JSON-RPC object.:

failed to parse incoming message: expected value at line 1 column 12

...

and the raw incoming payload starts with leaked Svelte markup such as <thead class="bg-muted/20 text-xs text-muted-foreground uppercase">

The leaked markup continues in subsequent log lines like acp-codex-log-with-error.txt:22243 and acp-codex-log-with-error.txt:22251, showing the file contents escaping the JSON envelope. After that, Codex starts reporting downstream tool-call failures such as Custom tool call output is missing in acp-codex-log-with-error.txt:32.

@rkboyce rkboyce marked this pull request as ready for review March 24, 2026 10:47
@benbrandt
Copy link
Copy Markdown
Member

Should be solved in the latest version

@benbrandt benbrandt closed this Mar 31, 2026
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