Repository navigation
Fix three CI regressions: code-span anchor, load-dispatch anchor, recordless pip install - #9959
Conversation
…ordless pip install Three unrelated failures, all reproduced locally first. 1. tests/studio/test_update_release_notes.py::test_code_span_closers_ignore_backslashes #9796 moved the code-span scanner into scanCodeSpans, which is defined ABOVE `export function codeSpans`. The test sliced the file from that export and counted `escaped(text` in the remainder, so the count went from 1 to 0 and the assertion "only an opener can be escaped" fired on a file where exactly one opener is still the only escaped thing. Count over the whole module and check the surviving call guards the opening run, so a wrapper moving again cannot read as "no opener is escaped either". 2. studio/backend/tests/test_parallel_slots_per_load.py::test_route_resolves_slots_once_before_dedupe_guard_and_load The GGUF load moved into _run_gguf_load_attempt, a health-wait helper defined above _load_model_impl, so `llama_backend.load_model` left the function body and .index() raised ValueError. Every ordering the test guards still holds. Anchor on whichever call the body dispatches a load through instead of on one backend's method name. 3. startup windows-latest pip will not replace a distribution whose .dist-info carries no RECORD, and an interrupted install leaves exactly that. The job reuses its venv, so the stub is not transient: once written, every later run dies the same way on "Cannot uninstall pydantic-core / no RECORD file was found". pip_install now retries once after clearing only the distributions pip named as unremovable, and only when it named one. pip's own hint is --ignore-installed, which would apply to every package in the command and skip real upgrades with it. run() grows check=False so pip_install can inspect a failure instead of exiting inside it; every existing caller keeps the old exit-on-failure behaviour.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
#9890 added staging support to studio/setup.ps1 and put an early `if ($StageRoot)` return inside Get-ManagedLlamaCppDir, which sits in the block install.ps1 holds a byte-identical copy of. The copy never got it, so test_denied_llama_cpp_preflight.py failed on exactly the drift it exists to catch, taking Repo tests (CPU) down with it. install.ps1 never assigns $StageRoot, and it runs under Set-StrictMode -Off from line 25 onwards, so the read is $null there and the branch is inert. Parity is what the block is for: the copies have to match or the next person edits one of them and only finds out in production.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8766605003
ℹ️ 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".
| if ($StageRoot) { | ||
| return (Join-Path $StageRoot "llama.cpp") |
There was a problem hiding this comment.
Keep the setup-only StageRoot out of the installer
When install.ps1 is invoked from a PowerShell session that already defines a nonempty $StageRoot (notably through the documented irm | iex flow), PowerShell's dynamic scope makes this function read the caller's variable because the installer never initializes its own $StageRoot. The installer then preflights <caller value>\llama.cpp instead of its managed cache and, for env-mode installs, bakes that unrelated path into UNSLOTH_LLAMA_CPP_PATH; an inaccessible caller path can also abort installation before downloads begin. Initialize an installer-local value or omit this setup-only staging branch here.
Useful? React with 👍 / 👎.
Three unrelated CI failures, each reproduced locally before changing anything.
1. Repo tests (CPU):
test_code_span_closers_ignore_backslashes#9796 moved the code-span scanner into
scanCodeSpans, which is defined aboveexport function codeSpans. The test sliced the file from that export and countedescaped(textin the remainder, so the count went 1 to 0 and "only an opener can be escaped" fired on a file where exactly one opener is still the only escaped thing.The behaviour is unchanged and correct:
escaped()guards the opening run, and the closer loop deliberately ignores backslashes, per CommonMark. Only the anchor was stale.Now counted over the whole module, with a second assertion that the surviving call is the one guarding the opener. A wrapper moving again cannot silently read as "no opener is escaped either".
2. Python 3.13:
test_route_resolves_slots_once_before_dedupe_guard_and_loadThe GGUF load moved into
_run_gguf_load_attempt, a health-wait helper defined above_load_model_impl, sollama_backend.load_modelleft the function body and.index()raisedValueError: substring not found.Every ordering the test guards still holds (guard < dispatch < load). It now anchors on whichever call the body dispatches a load through, rather than on one backend's method name.
This is the last of the 19 failures in that job. The other 18 are covered by #9952.
3. startup windows-latest
pip will not replace a distribution whose
.dist-infocarries noRECORD, because it cannot know which files to remove, and an interrupted install leaves exactly that. The job reuses its venv, so the stub is not transient: once written, every later run on that machine dies the same way, which is why this job fails on some PRs and not others.pip_installnow retries once after clearing only the distributions pip itself named as unremovable, and only when it named one. A blind retry would just double the wait; pip's own hint,--ignore-installed, would apply to every package in the command and skip real upgrades along with it.run()growscheck=Falsesopip_installcan inspect a failure instead of exiting inside it. Every existing caller keeps the old exit-on-failure behaviour.Verification
tests/studio/test_update_release_notes.py: 187 passedstudio/backend/tests/test_parallel_slots_per_load.py: 41 passedtests/python/test_install_python_stack.py: 157 passed, with the one remaining failure being the pre-existing diffusers-pin test that studio: fix audio ci tests #9953 fixes. With studio: fix audio ci tests #9953 applied on top: 158 passed.