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
Closed
Conversation
…cp and agent-shell, and change the client default to deny/limit.
…om/rkboyce/codex-acp into testing/addressing-security-issues
Member
|
Should be solved in the latest version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.