Repository navigation
CI: give the overlay rail harness the vite it needs, and tighten the wildcard-host detector - #9654
Conversation
…it is missing `Overlay rail shadow gutter, other engines` has failed on every studio-ui-smoke run since #9246 added it, and passed on #9246 itself. The difference is the frontend-dist cache. The harness serves its own vite via `npm run dev` in studio/frontend. That job never installs the frontend dev dependencies: it installs Studio, and setup.sh installs them only when it has to build the frontend. The frontend-dist cache exists precisely to stop that build, and the restore action asserts the installer reported the frontend up to date. So on a cache miss setup.sh builds, node_modules exists and the step passes; on a hit there is no node_modules, `npm run dev` exits 127 with `sh: 1: vite: not found`, and the step fails. #9246's own run missed the cache. Every run since has hit it. The harness is right and its use in studio-frontend-ci.yml is right, where `npm ci` has already run. Only the new step's assumption was wrong: what that shard has already paid for is the WebKit and Firefox install, not a frontend toolchain. So the shard installs the dependencies itself, conditional on the binary rather than unconditional, because on the cold-cache path setup.sh has already put them there and `npm ci` would delete and refetch them. The step then checks the binary actually arrived, since a silent install would surface later as a Playwright timeout rather than as a missing toolchain. start_vite now refuses up front with the cause and the remedy. "vite exited with code 127" reads as a vite crash; the toolchain was never installed, and the two must not look the same. This is what made the failure look like flake: identical job, identical commit, green or red depending on a cache key. While here, the wildcard-host detector added in #9623 only matched a command at the start of a line, so `UNSLOTH_STUDIO_PASSWORD=... unsloth studio -H 0.0.0.0` in the Launch section passed the guard. It now matches the command anywhere on the line. Twelve fixtures pin what the detector must catch and must not, because every negative assertion in that file passes when the detector sees nothing: a detector that quietly stops matching turns the whole file green while guarding nothing.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56a4bccd63
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| raise RuntimeError( | ||
| f"{host}:{port} is already serving. Stop it, or move this harness with SMOKE_PORT." | ||
| ) | ||
| _require_frontend_toolchain() |
There was a problem hiding this comment.
Preserve the lifecycle test's toolchain independence
On a fresh checkout without studio/frontend/node_modules, this new precondition makes test_start_vite_picks_the_platform_process_group fail before reaching its mocked Popen. That test explicitly promises that everything is monkeypatched and requires neither npm nor frontend dependencies, so focused lifecycle tests and clean Python-only test runs now fail unless an unrelated npm ci has run first. Mock this preflight in the lifecycle fixture or test the preflight separately while keeping the process-group unit test isolated.
Useful? React with 👍 / 👎.
| if [ -x node_modules/.bin/vite ]; then | ||
| echo "vite already present from the frontend build; not reinstalling" | ||
| else | ||
| npm ci --no-fund --no-audit |
There was a problem hiding this comment.
Apply the frontend install-script gate to this npm ci
On the warm-cache path this newly added npm ci runs under setup-node's bundled npm without the repository's pre-install supply-chain scan or --strict-allow-scripts. The hardened install in .github/workflows/studio-frontend-ci.yml lines 99-136 explicitly upgrades npm because Node 22 bundles npm 10, scans before installation because a compromised tarball's prepare/postinstall executes during npm ci, and then enforces the allowlist. As written, every banner shard bypasses those protections and executes any lifecycle script introduced through the lockfile; use the same guarded install sequence here, or --ignore-scripts if this Vite-only harness does not need lifecycle scripts.
Useful? React with 👍 / 👎.
|
Independently confirmed the overlay-rail half, and it matches your diagnosis exactly. Recording the evidence here so nobody re-opens the infra theory. Job 97391286915, step 31: Two things rule out the infra reading that the same log invites. That job carries
So no browser was ever reached. The step died in Confirming the mechanism you describe, from the same log: Verified locally that the install is sufficient:
On the second half, the
#9655 handles both: it parses the README's fenced blocks with no heading involved, and it derives the We overlap only on |
…efusal (unslothai#9656) unslothai#9654 added an up-front toolchain refusal to start_vite so a job with no node_modules fails with the cause instead of 'vite exited with code 127'. That is right, and the two process-group tests were simply not updated for the new precondition: they exercise which process-group flag the platform gets, they already stub the sibling _port_is_taken precondition for the same reason, and this file's own docstring promises nothing here touches npm or a real install. So the tests get a synthetic frontend tree in tmp_path with a vite shim, not a stubbed-out check. A stub would keep them green if the refusal were deleted; a tree makes the check run and pass on its merits. Adds the tests the refusal never had: it must reject a tree with no toolchain BEFORE anything is spawned, accept the bun and Windows shims as well as the POSIX name, and report a missing checkout as its own failure.
Picks up unslothai#9654 and unslothai#9656, which clear the overlay rail shard, and the Apertus mapping fix. No conflicts.
Two CI guards, one broken since yesterday and one weaker than it looks. Both diagnosed against the runs rather than guessed at.
The overlay rail step has never worked on a warm cache
Overlay rail shadow gutter, other engines (Playwright)has failed on everystudio-ui-smokerun since #9246 added it, and passed on #9246's own run. Identical commit content, opposite result, so it reads as flake. It is not.The harness serves its own vite through
npm run devinstudio/frontend. That job never installs the frontend dev dependencies. It installs Studio, andstudio/setup.shinstalls them only when it has to build the frontend. The frontend-dist cache exists precisely to stop that build, andfrontend-dist-restoreasserts the installer reported the frontend up to date. So:node_modulesexists, the step passesnode_modules,npm run devexits 127 withsh: 1: vite: not found, the step fails#9246's run logged
Cache not found for input keys: fe-dist-Linux-4b4d8135.... The runs since logCache hitfor the same key.The harness is not at fault, and neither is its use in
studio-frontend-ci.yml, wherenpm cihas already run. Only the new step's assumption was wrong. Its comment says the step sits on that shard because "WebKit's install is already paid for", which is true of the browsers and not of the toolchain.So the shard installs the dependencies itself, conditional on the binary rather than unconditional: on the cold-cache path setup.sh has already put them there, and
npm ciwould delete and refetch them for nothing. The step then checks the binary arrived, because a silent install would surface later as a Playwright timeout instead of a missing toolchain.I kept the step where it is rather than moving it to
studio-frontend-ci.yml. Moving it would trade annpm cifor aplaywright install firefox webkit, and the reason the step is on this shard in the first place is that those two browsers are already there.start_vite now names the cause
"vite exited with code 127" reads as a vite crash. The toolchain was never installed, and no retry or port change helps. A missing toolchain and a broken one are different failures and must not look the same, so
start_viterefuses up front with the cause and the remedy, including why a dist-cache job in particular ends up without one. This is what made the failure look like flake for a day.The wildcard-host detector let a real shape through
Separately, the detector added in #9623 anchored on a command at the start of a line:
Documented commands are regularly prefixed, and
UNSLOTH_STUDIO_PASSWORD='x' unsloth studio --host=0.0.0.0in the Launch section passed the guard. Confirmed by injecting it intoREADME.md: exit 0 before, exit 1 now. It matches the command anywhere on the line instead.Twelve fixtures pin the detector itself. Every negative assertion in that file passes when the detector sees nothing, so a detector that quietly stops matching turns the whole file green while guarding nothing:
To be clear about #9623 itself: its rescoping was right. The README moved the
-H 0.0.0.0opt-in out of#### Launchand into#### Remote HTTPS & LAN Accessin e264bba, which is a better home for it, so the guard's assumption about where the text lived was the thing that was wrong, not the README. This only tightens the detector it introduced.Checked
tests/sh/test_install_host_defaults.sh: 23 passed, 0 failed on a clean tree. Mutation-tested, all four caught, and clean again afterwards:unsloth studio -H 0.0.0.0in LaunchUNSLOTH_STUDIO_PASSWORD='x' unsloth studio --host=0.0.0.0in Launch$ unsloth studio -H 0.0.0.0in Launch_require_frontend_toolchainverified both directions: it raises on a tree with nonode_modules,start_viterefuses before spawning npm, and it accepts a tree carryingviteor the Windowsvite.cmd. shellcheck clean at-S warning, ruff clean,bash -nclean, and the workflow parses with the install step ordered ahead of the overlay rail step.