fix: CLI fails to start on Windows with process.execve unavailable - #8
Conversation
Windows Node defines process.execve but throws ERR_FEATURE_UNAVAILABLE_ON_PLATFORM when it is called, so the existence check routed Windows into execve and the CLI failed to start. Route win32 to the spawn fallback before touching execve.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 21 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
Comment |
commit: |
Name the published docs site and Pythoughts-labs/pythinker-code explicitly in gen-docs and sync-changelog instead of generic placeholders.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @pythoughts/pythinker-code@0.6.1 ### Patch Changes - [#7](#7) [`d396320`](d396320) - Prompt for an API key when connecting a catalog provider whose environment variable is not set, instead of failing with "Environment variable is not set or is empty". Applies to `/login`, `/provider`, and `pythinker provider catalog add`, which now also accepts `--api-key <key>`. - [#7](#7) [`d396320`](d396320) - Explain in `/update` and the startup update notice that Homebrew installs do not auto-update, and point to the native installer for automatic background updates. - [#7](#7) [`d396320`](d396320) - Point the native install scripts at the published release assets. - [#7](#7) [`d396320`](d396320) - Show a clear requirement message with the native-installer alternative when the CLI is launched on Node.js older than 26.4, instead of failing with a cryptic flag error. - [#8](#8) [`9b1b195`](9b1b195) - Fix the CLI failing to start on Windows with "process.execve is unavailable" by using the spawn fallback instead of calling execve there. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Related Issue
No linked issue — problem explained below.
Problem
On Windows,
pythinkerinstalled via npm fails immediately:Windows Node defines
process.execveas a function that throwsERR_FEATURE_UNAVAILABLE_ON_PLATFORMwhen called. The launcher's existence check (process.execve !== undefined) therefore routed Windows into the execve path and crashed before the existing spawn fallback could run.What changed
The launcher checks the platform first: win32 always uses the spawn fallback; the execve path (which preserves pid, process group, and controlling terminal) remains for POSIX. Added a regression test that fakes win32 with a throwing
execveand asserts the fallback child completes — verified it fails against the previous launcher.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.