Repository navigation
Conversation
runProcessSync passed encoding 'buffer' to spawnSync, which also uses that value to encode a string input and throws ERR_UNKNOWN_ENCODING. On Windows that broke Chrome cookie import before the key helper ran. Pass null instead, which still returns Buffers. Fixes stablyai#27617
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Windows Chrome key extraction can now pass string stdin without the encoding exception, and the regression test covers the helper’s Unicode round trip. No concrete merge-blocking risk remains in this change. Pre-merge checks |
|
|
Superseded by merged PR #28225. The fix is now on main, and your contribution is credited in the merged commit through its Co-authored-by footer. |
ELI5
Importing Chrome cookies on Windows failed every time with a message blaming the OS. The real cause was a small mistake in how Orca starts a helper program, and this fixes it.
What Changed
Before: Settings → Browser → Import on Windows failed with 'Could not access Google Chrome encryption key', and the diagnostic log showed
ERR_UNKNOWN_ENCODING: Unknown encoding: buffer. After: the helper that reads Chrome's key actually runs.runProcessSyncpassedencoding: 'buffer'tospawnSync. Node also uses that value to encode a stringinput, and 'buffer' isn't a valid encoding there, so it threw before the child process started. It now passesencoding: null, which still returns Buffers, so the output handling is unchanged.Why
Any synchronous caller that sends a string to stdin hit this, and the cookie key helper is the one users see. I considered converting the input to a Buffer first, but
nullis the documented way to ask for raw output and it's a one-word change. I left the 'OS may have denied access' wording alone to keep this small, so a real key failure still reads the same as before.This overlaps #19298 and #19304, which fix the same bug for #18670. Both were opened on 2026-09-07 against
src/shared/child-process/run-process.ts, and that code has since moved tosrc/packages/process-host, so I don't think they apply tomainany more. I'm happy to close this one if a maintainer would rather revive either of those.Linked Issue
Fixes #27617
Visual Proof
N/A - no UI change, this only stops the helper process from failing to start.
Testing
I reproduced the throw with plain Node on macOS (
spawnSyncwith string input andencoding: 'buffer'throws,nullworks), then added a regression test that feeds string input throughrunProcessSync. It fails without the fix.pnpm teston the process runner suites passes (3 files, 29 tests), along withpnpm tc:node,oxlint,oxfmt --checkandpnpm run check:code-quality:changed. I did not run the cookie import on Windows, I don't have a Windows machine here.AI Disclosure
Claude Opus 5.5 (Claude Code) picked the issue, confirmed the cause, and wrote the change and the test. I reviewed the diff before opening this.
Review
Agent skill upstream boundary
Notes
This doesn't add support for Chrome's app-bound cookie encryption, it only removes the exception that hid whatever happens next.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)