Repository navigation
fix(process-host): accept string stdin in synchronous runs - #28225
Merged
Merged
Conversation
Request raw subprocess output with null encoding so Node can encode string stdin as UTF-8. Preserve explicit text decoding and byte capture, with real-runner coverage for both output modes. Co-authored-by: Joe Esposito <[email protected]>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Oct 14, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
The helper that reads Chrome's encryption key on Windows could fail before starting because Orca used an invalid text setting. The helper can now receive its input.
What Changed
Before, sending string input through the synchronous process runner threw
ERR_UNKNOWN_ENCODING: Unknown encoding: buffer. Windows Chrome cookie import uses that runner to send input to its key helper, so users saw an encryption-key access error before the helper ran.The runner now requests raw output with
encoding: null. Node can encode the string input correctly, while Orca still receives binary output and explicitly decodes text output as UTF-8.Why
Changing the raw-output option fixes the shared runner directly, rather than adding an input conversion workaround to the cookie importer. This keeps its existing command resolution, hidden Windows console, timeout, and output handling.
Linked Issue
Fixes #27617
Visual Proof
N/A — this changes a subprocess option, with no rendered UI or interaction change. Proof comes from the actual runner executing harmless input before and after the fix.
Testing
Cross-platform verification: the final combined branch passed 27 focused suites on each execution host: macOS 349 passed, Linux 349 passed, Windows 348 passed and 1 platform skip. Core typecheck, changed-code quality (67 files, zero findings), and the production Electron bundle build also passed. Tests ran in dedicated background worktrees through Orca; native Windows/Linux UI and private cookie imports were not exercised.
Under actual Node 24.20.0, the built production package failed before the fix with
ERR_UNKNOWN_ENCODING: Unknown encoding: buffer. After rebuilding, the identical command returned{"code":0,"output":"nonsecret-probe"}:node -e "const {runProcessSync}=require('@orca/process-host'); try { const r=runProcessSync({program:process.execPath,args:['-e','process.stdin.pipe(process.stdout)'],input:'nonsecret-probe',timeoutMs:3000}); console.log(JSON.stringify({code:r.code,output:r.stdout})); } catch (e) { console.error(e.code+': '+e.message); process.exitCode=1; }"Two new real-runner regression cases failed before the fix and pass after. They verify Unicode string input, Unicode diagnostic output, decoded text output, and raw NUL/invalid UTF-8 bytes. They live in the existing suite required to run under real Node even through the default Bun-backed test command.
git diff --checkpassed.No private cookies or encryption keys were used.
Final platform verification: tested together with the other reviewed fixes in 59 selected suites. macOS: 748 passed. Linux: 748 passed. Windows: 725 passed, 13 platform skips (including the Bash-only suite). Core typecheck, changed-code quality (zero new findings), and the production Electron bundle build passed. UI screenshots are hidden macOS renderers; fixture and live-host limits are described above.
Merge verification: all required CI checks passed before merging. Community co-author credit, where applicable, was verified in the actual squash commit. Native Windows awin (Node24.18.0) reproduced the original
ERR_UNKNOWN_ENCODINGbefore child startup. The fixed real runner preserves Unicode stdin, binary stdout and diagnostic stderr; the real Windows DPAPI function recovered a synthetic32-byte key after failing on the baseline. No private browser data was accessed; app-bound encryption was not tested.Review
Reviewed community PR #27683 as a cross-reference and credited Joe Esposito as a commit co-author. Independent review found no blocking issues. The production change is one encoding option. Merge risk is low, with no negative user-facing trade-offs identified. The execution host still owns subprocess execution; SSH behavior and wire compatibility do not change. Folder workspaces and mobile presentation do not depend on this option.
Agent skill upstream boundary
Notes
This removes the reported subprocess exception. It does not add support for Chrome's app-bound cookie encryption or change the existing error wording when key extraction fails for another reason. Full lint, full multi-project typechecking, full test suite, and build were not run locally; CI covers these broader checks.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)