Skip to content

Prefer local reads for .svelte files to avoid ACP stdio failures related to additional newlines #204

Closed
rkboyce wants to merge 14 commits intozed-industries:mainfrom
rkboyce:fix/svelte-local-read
Closed

Prefer local reads for .svelte files to avoid ACP stdio failures related to additional newlines #204
rkboyce wants to merge 14 commits intozed-industries:mainfrom
rkboyce:fix/svelte-local-read

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 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 and others added 14 commits December 20, 2025 08:16
…cp and agent-shell, and change the client default to deny/limit.
Add filesystem sandboxing/approval for ACP read/write
allows a client to monitor token usage as a session progresses
…s models when called without args; with args it sets the model (and optional

        reasoning effort) and confirms. /status and /approvals reply immediately and end the turn.
      - Token usage now forwarded: TokenCount events emit a plain agent message like “Context usage: used …” so clients can show remaining context.
      - Added helpers for status/approvals/model text and model arg parsing.
      - Tests added for /status, /approvals, /model list/set; stub conversation updated to handle model overrides. cargo test --tests conversation passes
…-save-summary

Feature/slash commands token count save summary
@rkboyce rkboyce closed this Mar 24, 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.

1 participant