Skip to content

fix(hindsight-embed): use sysconfig to find scripts dir in daemon start#1425

Merged
nicoloboschi merged 4 commits intomainfrom
fix/embed-daemon-scripts-dir
May 4, 2026
Merged

fix(hindsight-embed): use sysconfig to find scripts dir in daemon start#1425
nicoloboschi merged 4 commits intomainfrom
fix/embed-daemon-scripts-dir

Conversation

@nicoloboschi
Copy link
Copy Markdown
Collaborator

Summary

Test plan

  • Updated existing test_find_api_command_* tests to use sysconfig.get_path mock
  • All 10 embed manager tests pass
  • All 11 profile daemon config tests pass

…command (#1401)

`Path(__file__).parent.parent` resolves to site-packages/ in stock pip
venvs, missing the actual scripts dir (<venv>/bin or <venv>/Scripts).
Use `sysconfig.get_path("scripts")` which works across pip venvs, conda,
and --target installs.
The TestAbortSignal tests use jest.spyOn which doesn't exist under Deno.
Add a mock implementation (matching the pattern in the AI SDK's
vitest-compat.ts) so these tests pass with deno test.
Deno freezes ES module namespace objects, so jest.spyOn cannot patch
sdk exports. Skip these spy-based unit tests under Deno (they're
already covered by the Jest suite).
… installs

sysconfig.get_path("scripts") correctly fixes stock venv installs
(#1401) but doesn't cover `pip install --target` layouts where the
binary sits alongside site-packages contents. Keep the original
Path(__file__)-based lookup as a second fallback before uvx (#1240).
@nicoloboschi nicoloboschi merged commit 0f15f76 into main May 4, 2026
56 checks passed
liling pushed a commit to liling/hindsight that referenced this pull request May 5, 2026
…rt (vectorize-io#1425)

* fix(hindsight-embed): use sysconfig to find scripts dir in _find_api_command (vectorize-io#1401)

`Path(__file__).parent.parent` resolves to site-packages/ in stock pip
venvs, missing the actual scripts dir (<venv>/bin or <venv>/Scripts).
Use `sysconfig.get_path("scripts")` which works across pip venvs, conda,
and --target installs.

* fix(typescript-client): add jest.spyOn/fn shim to deno_setup.ts

The TestAbortSignal tests use jest.spyOn which doesn't exist under Deno.
Add a mock implementation (matching the pattern in the AI SDK's
vitest-compat.ts) so these tests pass with deno test.

* fix(typescript-client): skip TestAbortSignal under Deno

Deno freezes ES module namespace objects, so jest.spyOn cannot patch
sdk exports. Skip these spy-based unit tests under Deno (they're
already covered by the Jest suite).

* fix(hindsight-embed): restore __file__-relative fallback for --target installs

sysconfig.get_path("scripts") correctly fixes stock venv installs
(vectorize-io#1401) but doesn't cover `pip install --target` layouts where the
binary sits alongside site-packages contents. Keep the original
Path(__file__)-based lookup as a second fallback before uvx (vectorize-io#1240).
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.

hindsight-embed daemon falls back to uvx after stock pip install because it looks for hindsight-api.exe in the wrong directory

1 participant