fix(hindsight-embed): use sysconfig to find scripts dir in daemon start#1425
Merged
nicoloboschi merged 4 commits intomainfrom May 4, 2026
Merged
fix(hindsight-embed): use sysconfig to find scripts dir in daemon start#1425nicoloboschi merged 4 commits intomainfrom
nicoloboschi merged 4 commits intomainfrom
Conversation
…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).
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).
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.
Summary
hindsight-embed daemonfalls back touvxafter stockpip installbecause it looks forhindsight-api.exein the wrong directory #1401 —hindsight-embed daemon startfalls back touvxafter stockpip installbecause_find_api_commandlooks for the entry-point binary relative to__file__(which is insidesite-packages/), not in the venv's actual scripts directory.Path(__file__).parent.parent / {bin,Scripts}withsysconfig.get_path("scripts"), which correctly resolves to<venv>/bin(POSIX) or<venv>/Scripts(Windows) across pip venvs, conda envs, and--targetinstalls.Test plan
test_find_api_command_*tests to usesysconfig.get_pathmock