Skip to content

fix(embed): show actionable message when npx is missing on PATH#1688

Closed
benfrank241 wants to merge 1 commit into
mainfrom
fix/embed-missing-npx-message
Closed

fix(embed): show actionable message when npx is missing on PATH#1688
benfrank241 wants to merge 1 commit into
mainfrom
fix/embed-missing-npx-message

Conversation

@benfrank241
Copy link
Copy Markdown
Contributor

Summary

  • When the UI launcher hits a system without npx (common on Windows without Node.js), start_ui no longer surfaces the generic red "Command Not Found" panel. Daemon stays healthy and usable; the panel now reframes the UI as optional with concrete next steps (Node.js download link + hindsight-embed ui start follow-up).
  • Pre-flight check with shutil.which so we catch the missing binary up-front instead of relying on FileNotFoundError from subprocess.Popen — that path is brittle on Windows where PATH resolution can diverge between Python and the OS loader.

Motivation

User report on the community channel: daemon started fine, then this hard-failure panel scared them off — they thought the whole setup was broken. It wasn't; only the UI was unavailable because Node.js wasn't installed.

Test plan

  • uv run pytest tests/test_embed_manager.py -v — 12/12 pass, including new test_start_ui_skips_spawn_when_npx_missing
  • ./scripts/hooks/lint.sh clean
  • Manual smoke on a host without npx: confirm the new panel renders and the daemon URL is shown

The UI launcher previously raised a generic "Command Not Found" panel when
npx wasn't installed (common on Windows without Node.js). This obscured the
fact that the daemon was healthy and the API was usable.

- Pre-flight check with shutil.which before subprocess.Popen so the failure
  is caught cleanly instead of relying on FileNotFoundError plumbing.
- Reframe the panel: the daemon is running and usable now; the UI is
  optional; include the nodejs.org install link and the follow-up
  `hindsight-embed ui start` command.

Also pulls in the docs-skill regeneration from the pre-commit hook.
@benfrank241
Copy link
Copy Markdown
Contributor Author

Closing in favor of #1682 — that PR fixes the actual root cause (Windows detached subprocess not inheriting PATH), which is what TunaCookie originally hit. My messaging improvements here aren't worth carrying separately once the bug itself is gone.

@benfrank241 benfrank241 deleted the fix/embed-missing-npx-message branch May 21, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant