fix(embed): resolve npx absolute path on Windows before spawning UI#1682
Merged
nicoloboschi merged 1 commit intoMay 25, 2026
Merged
Conversation
On Windows, subprocess.Popen with DETACHED_PROCESS does not inherit
the parent's PATH, causing 'Command not found: npx' even when npx
is installed and available in the shell.
Use shutil.which('npx') to resolve the absolute path before passing
it to subprocess. Falls back to bare 'npx' so FileNotFoundError
handlers can still report the missing command cleanly.
Fixes vectorize-io#1681
3 tasks
Contributor
|
@tuancookiez-hub thanks for this. One small nit, could you move |
nicoloboschi
approved these changes
May 25, 2026
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.
Problem
On Windows 11, running
hindsight-embed -p <profile> ui startin local/embedded mode fails with:even when
npxis installed and available in the user's PATH.Root Cause
subprocess.Popen()withcreationflags=DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUPon Windows spawns a process that does not inherit the parent's PATH environment. The bare stringnpxcannot be resolved in the detached process context.Fix
Use
shutil.which("npx")to resolve the absolute path tonpxbefore spawning the subprocess. Falls back to the barenpxcommand so that existingFileNotFoundErrorerror handlers can still report the missing command cleanly.Changes
hindsight-embed/hindsight_embed/daemon_embed_manager.py:_find_ui_command()methodTesting
npxresolves toC:\Program Files\nodejs\npx.cmdnpxis truly missingFixes #1681