Skip to content

fix(acp-client): filter non-JSON stdout from local ACP shell initialization#347

Merged
matt2e merged 1 commit intomainfrom
passing-hermit-output-to-acp
Mar 5, 2026
Merged

fix(acp-client): filter non-JSON stdout from local ACP shell initialization#347
matt2e merged 1 commit intomainfrom
passing-hermit-output-to-acp

Conversation

@matt2e
Copy link
Contributor

@matt2e matt2e commented Mar 5, 2026

Summary

  • Add normalize_local_acp_stdout to filter non-JSON lines from local ACP child process stdout, matching the existing remote normalization approach
  • Prevents shell initialization output (Hermit activation, .zshrc banners, plugin messages) from reaching the JSON-RPC parser and crashing the session
  • Includes tests for filtering and empty input

🤖 Generated with Claude Code

…zation

When spawning local ACP agents in an interactive shell, hermit activation
messages and other shell init output are written to stdout before `exec`
replaces the shell with the agent binary. These non-JSON lines reach the
JSON-RPC parser and cause parse errors.

Add `normalize_local_acp_stdout` which reads lines from the child's stdout
and only forwards those that parse as valid JSON, dropping shell init noise.
This mirrors the normalization already applied to remote sessions but with
a simpler implementation since local stdout doesn't have the encoding and
record-separator concerns of SSH-proxied connections.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@matt2e matt2e requested review from baxen and wesbillman as code owners March 5, 2026 05:08
@matt2e matt2e merged commit 6a47301 into main Mar 5, 2026
6 checks passed
@matt2e matt2e deleted the passing-hermit-output-to-acp branch March 5, 2026 05:13
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