feat(cli): self-provision pinned uv and defer MCP Python runtime install#297
Merged
Conversation
Fixes a production crash-loop (PostHog issue 019eb68e): ktx mcp start --foreground on a uv-less container eagerly installed the managed Python runtime at boot, failed, and was restarted by its supervisor every ~62s (122 exceptions from one install). - MCP server factory now wires a lazy semantic-layer compute port that defers the runtime install to the first call, mirroring the already-lazy SQL-analysis port; the server boots and serves non-Python tools without the runtime. - ktx no longer requires uv on PATH: it downloads its own pinned, sha256-verified uv build under the runtime root (KTX_RUNTIME_ROOT aware), always musl-static on Linux. PATH uv is never consulted. - uv is acquired before the version dir is wiped, so a failed download cannot destroy an existing runtime. - Acquisition failures (offline, intercepted download, unsupported platform) throw KtxExpectedError and stay out of Error Tracking; a missing binary inside a checksum-verified archive remains a plain Error. - scripts/refresh-uv-manifest.mjs regenerates the pinned manifest (packages/cli/src/managed-uv-release.ts) on uv bumps. - Setup consent prompt now discloses the uv download; docs updated.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Fixes a production crash-loop (PostHog issue 019eb68e) where
ktx mcp start --foregroundon a uv-less container eagerly installed the managed Python runtime at boot, failed, and was supervisor-restarted every ~62s — 122 exceptions from one install.The MCP server factory now wires a lazy semantic-layer compute port that defers the runtime install to the first call (mirroring the already-lazy SQL-analysis port), so the server boots and serves non-Python tools regardless. ktx no longer requires uv on PATH at all: it downloads its own pinned, sha256-verified uv build under the runtime root (
KTX_RUNTIME_ROOT-aware, musl-static on Linux, never consulting PATH), acquired before the version dir is wiped so a failed download cannot destroy an existing runtime. Acquisition failures (offline host, intercepted download, unsupported platform) throwKtxExpectedErrorand stay out of Error Tracking, while a missing binary inside a checksum-verified archive remains a plainErrorso release faults still surface.scripts/refresh-uv-manifest.mjsregenerates the pinned manifest on uv bumps, the setup consent prompt now discloses the uv download, and thektx mcp/ktx admindocs reflect the zero-prerequisite install.