Repository navigation
fix(cli): text-to-speech ignores a foreign PYTHONPATH when it looks for kokoro-onnx - #6769
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Verdict: APPROVE · 0 blockers · 1 important · 0 nits · head e66071aa
I confirmed the fails without the fix: claim. With the three pythonEnv call sites reverted, never reaches the Python that probes for packages and runs the synthesis process without a foreign PYTHONPATH fail; with the fix, src/tts passes 34/34. CI is green.
Scope
Read the full diff, every hasPythonModules caller (audio/providers.ts, commands/doctor.ts) and the beat-this provider, which still spawns its own Python with the inherited env, as the body says. No prior reviews.
…kages fail with it
sshlg
pushed a commit
to ssheleg/hyperframes-agent
that referenced
this pull request
Oct 30, 2026
Upstream heygen-com#6769 (text-to-speech drops a foreign PYTHONPATH) met the speech patch in packages/cli/src/tts. Upstream picks the environment the packages import under and runs the synthesis there; the patch's probePythonPackage now takes that environment and still names the import's own error when neither environment imports kokoro-onnx and soundfile. The tts tests pass (41 of 41), with one new case for soundfile's own error. Committed with --no-verify: the pre-commit fallow audit against origin/main counts upstream's own findings in v0.8.211..v0.8.221 as new. All ten it calls introduced are in files identical to the tag (layout-audit, layoutAudit, inspector tests, layout.ts, drawElementService, webkit-stops, thumbnailDiskCache); bun run build, bun run lint and the hook's typecheck pass (fork/README.md, "Taking an upstream release", 3). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
What
Text-to-speech and its package checks try the caller's
PYTHONPATHfirst and drop it only when the packages do not import with it, sokokoro-onnxis found in the interpreter the CLI picked.Why
With a
PYTHONPATHthat points at another Python's packages,import kokoro_onnxwas resolved against that folder (or shadowed by it) and the check failed. The CLI then reportedkokoro-onnxas not installed although it was installed for the chosen interpreter.Related work
No open PR touches this.
How
tts/python.tsprobes with the inherited environment, then withPYTHONPATHremoved, and returns the first that imports the packages. The two package probes use that, and synthesis runs in the environment that worked, so aPYTHONPATHset on purpose (pip install --target, a nix-shell) keeps working.HYPERFRAMES_PYTHONstill selects the interpreter. The beat-detection provider spawns its own user-supplied Python and is unchanged.Test plan
fails without the fix: with the inherited probe removed (strip always),
keeps a PYTHONPATH the user set on purpose when the package needs itandtries the inherited environment first and reports a package neither findsfail.What I measured
src/tts: 35 passed on three consecutive runs; oxlint and oxfmt clean.What I did NOT execute
A real synthesis with kokoro-onnx and a foreign
PYTHONPATH; the tests assert the environment handed to Python. A foreignPYTHONHOMEis not handled.