Skip to content

feat(setup): warm the uv runtime before first server launch - #136

Merged
yjouini merged 3 commits into
mainfrom
feat/prewarm-setup-runtime
Sep 4, 2026
Merged

yjouini merged 3 commits into
mainfrom
feat/prewarm-setup-runtime

Conversation

@yjouini

@yjouini yjouini commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a runtime warm-up step to the dataiku-headless-setup skill added in #129. The host gives up on an MCP server that is still downloading dependencies on its first launch, which is the most common cause of a plugin that appears installed but never becomes available — the "restart Codex / still initializing" reports in #ask-dataiku-headless.

The new step 5 runs the server once with stdin closed so it exits immediately, populating the uv cache and the script environment before the host ever launches it. Subsequent steps are renumbered; the frontmatter description now mentions the warm-up.

Why run-and-exit rather than uv sync

uv sync --locked --script looks like the natural fit but only gets partway. Measured on this branch with a throwaway UV_CACHE_DIR (so the real cache was untouched), timing a full MCP initialize round-trip against bin/run_mcp.py:

uv sync --script caches the downloads but leaves the environment to be created on first launch, so the host still sees a slow first start. The skill therefore uses the run-and-exit form and says explicitly not to substitute sync. A cold cache for this script is ~148 MB, so on a slow or proxied network the 6.36s figure is a floor, not a typical case.

@yjouini
yjouini marked this pull request as ready for review August 27, 2026 12:19
yjouini and others added 3 commits September 3, 2026 18:17
The host gives up on an MCP server that is still downloading dependencies
on its first launch, which is the most common cause of a plugin that never
becomes available after install. Warm the runtime during setup instead.

Measured on a throwaway UV_CACHE_DIR, time to answer MCP initialize:

  no warm-up                          6.36s
  after `uv sync --locked --script`   2.80s
  after one run with stdin closed     0.65s

`uv sync --script` caches the downloads but leaves the environment to be
created on first launch, so the skill uses a single run-and-exit instead
and says explicitly not to substitute sync.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@pmasiphelps
pmasiphelps force-pushed the feat/prewarm-setup-runtime branch from 26d6f28 to 67ec438 Compare September 3, 2026 22:18
@pmasiphelps
pmasiphelps self-requested a review September 3, 2026 22:18

@pmasiphelps pmasiphelps left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! i made a slight change to the wording of the run_mcp relative path....codex complained about the previous wording. totally fine if you don't like the new wording. approved either way.

@yjouini
yjouini merged commit 40315f5 into main Sep 4, 2026
8 checks passed
@yjouini
yjouini deleted the feat/prewarm-setup-runtime branch September 4, 2026 08:08
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.

2 participants