fix(cli): decode daemon replies as streaming UTF-8
Closed
HA
7d ago+62+62+01234567890123456789-1-1-0123456789
why
Fixes #3462. The browse CLI prints � instead of non-ASCII page text when a large daemon reply arrives in several socket chunks and a chunk boundary falls inside a multi-byte character. The client decoded each chunk on its own with chunk.toString().
what changed
packages/cli/src/lib/driver/daemon/client.ts: callsocket.setEncoding("utf8")so Node decodes across chunk boundaries, and append the string chunk.- New test
packages/cli/tests/daemon-client-decoding.test.ts: a real unix-socket fake daemon writes one reply split inside the 3-byte日. - Changeset:
browsepatch.
test plan
- New test fails on
main('���本語 ✓'instead of'日本語 ✓') and passes with the fix. packages/cli: format check, oxlint, typecheck, and the full vitest suite afterpnpm build(582 tests) pass.- Repo-wide
just check/just testnot run; checks above are scoped topackages/cli.
🤖 Generated with Claude Code
Summary by cubic
Fixes #3462: the browse CLI printed � instead of non-ASCII page text when a large daemon reply arrived across socket chunks and a chunk boundary fell inside a multi-byte character. The daemon client now calls socket.setEncoding("utf8") so Node decodes across chunk boundaries instead of decoding each chunk separately.
- Adds a test with a real unix-socket fake daemon that splits a reply inside the 3-byte
日. - Adds a
browsepatch changeset.