Skip to content

[Claimed #3463] fix(cli): decode daemon replies as streaming UTF-8 - #3473

Merged
shrey150 merged 2 commits into
mainfrom
external-contributor-pr-3463
Nov 17, 2026
Merged

shrey150 merged 2 commits into
mainfrom
external-contributor-pr-3463

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Mirrored from external contributor PR #3463 after approval by @shrey150.

Original author: @harjothkhara
Original PR: #3463
Approved source head SHA: 25129a98aef616b9faf9b2b5a20abf2ec74b11fb

@harjothkhara, please continue any follow-up discussion on this mirrored PR. When the external PR gets new commits, this same internal PR will be marked stale until the latest external commit is approved and refreshed here.

Original description

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: call socket.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: browse patch.

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 after pnpm build (582 tests) pass.
  • Repo-wide just check / just test not run; checks above are scoped to packages/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 browse patch changeset.

Written for commit 25129a9. Summary will update on new commits.

View guided diff

harjothkhara and others added 2 commits November 15, 2026 01:09
The daemon client called chunk.toString() per socket chunk, so a multi-byte
character split across chunks became U+FFFD. Use socket.setEncoding("utf8").

Fixes #3462

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:mirrored An internal mirrored PR currently exists for this external contributor PR. labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

This mirrored PR has been merged into main. The original external PR #3463 is now completed.

@changeset-bot

changeset-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f468052

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
browse Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@shrey150
shrey150 merged commit 0f9a64c into main Nov 17, 2026
25 checks passed
@shrey150
shrey150 deleted the external-contributor-pr-3463 branch November 17, 2026 01:05
@github-actions github-actions Bot added external-contributor:completed The mirrored PR has been merged and the external contributor flow is complete. and removed external-contributor:mirrored An internal mirrored PR currently exists for this external contributor PR. labels Nov 17, 2026
shrey150 pushed a commit that referenced this pull request Nov 19, 2026
Release Browse independently of the Stagehand SDKs. Merging this PR
publishes the CLI from the merged commit.

## 0.12.0

### Minor Changes

- [#3482](#3482)
[`8901460`](8901460)
Thanks [@suyashguptasg](https://github.com/suyashguptasg)! - Add `--size
regular|large|xlarge` to `browse cloud sessions create` to select the
browser size.

- [#3499](#3499)
[`a5a19ea`](a5a19ea)
Thanks [@shrey150](https://github.com/shrey150)! - Remove deprecated
`browse cloud contexts update`; context uploads are no longer supported.

### Patch Changes

- [#3450](#3450)
[`c118e9c`](c118e9c)
Thanks [@shrey150](https://github.com/shrey150)! - Add `browse discord`
command to open the Stagehand Discord in your system browser

- [#3473](#3473)
[`0f9a64c`](0f9a64c)
Thanks [@github-actions](https://github.com/apps/github-actions)! - fix
the CLI printing replacement characters when a daemon reply splits a
multi-byte character across socket chunks

- [#3451](#3451)
[`902e91b`](902e91b)
Thanks [@shrey150](https://github.com/shrey150)! - Add Discord and
GitHub links to root help footer and support hints on unexpected errors

- [#3481](#3481)
[`ebf15c8`](ebf15c8)
Thanks [@shrey150](https://github.com/shrey150)! - Add search filtering
options and migrate cloud commands to the Browserbase SDK.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor:completed The mirrored PR has been merged and the external contributor flow is complete. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Browse CLI returns U+FFFD instead of the real text when a daemon reply splits a multibyte character

2 participants