Repository navigation
Re-check whisper after the llama phase, so it stops raising a second banner - #10026
danielhanchen wants to merge 1 commit into
Conversation
…banner The combined update item plans every phase before any of them runs, so whisper is judged against the llama build that is about to be replaced. A llama update that is itself what makes a newer whisper available, or what first makes one pairable, was therefore invisible at planning time. The job finished, the next poll saw whisper behind, update_component flipped from llama to whisper, and the same banner came straight back naming whisper.cpp. Two popups for what the code calls the single main update item. Re-plan whisper once the new llama is in place and run it in the same job. paired_llama_will_update is False by then, so the plan consults the installer's read-only resolver and skips cleanly when no compatible whisper release exists, rather than attempting an install that cannot succeed. That is the pairing gap that kept whisper pinned to b10472-mix-4b653db while llama shipped four releases. Two things this deliberately preserves. A phase can now report a skip from its result, not only from its plan, so the breakdown still reads "skipped: up_to_date" or "skipped: local_link" instead of degrading to a success with no message. Deciding later must not mean explaining less. The re-check is scheduled only when the probe produced a plan. An empty one means the piggyback is disabled or the probe failed, and re-importing the module there would undo the fail-open that keeps a broken whisper from taking a llama update down with it.
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1318dc6155
ℹ️ 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 whisper_spec.get("repair") | ||
| else (lambda set_progress: _whisper.run_chained_phase(whisper_spec, set_progress)) | ||
| ) | ||
| elif backend_request is None and llama_spec is not None and whisper_plan: |
There was a problem hiding this comment.
Schedule the late recheck only for eligible whisper plans
When whisper is a local link, source build, or not installed, chained_phase_plan() still returns a nonempty plan with no runnable phase, so this condition turns a permanent skip into a runnable late phase. Consequently the job announces that it is installing both llama.cpp and whisper.cpp, reserves 30% of progress for whisper, and initially reports whisper as pending even though the installation is unmanaged and can only be skipped. Restrict the recheck to plans whose state can actually change after the llama update, such as skip_reason == "up_to_date".
Useful? React with 👍 / 👎.
| is reported as a skip carrying the plan's reason, so the phase breakdown reads the | ||
| same as it did when the decision was made before the job started. | ||
| """ | ||
| plan = chained_phase_plan(force_refresh = True, paired_llama_will_update = False) |
There was a problem hiding this comment.
Keep the post-llama probe fail-open
If this second status probe raises after the llama installer has succeeded—for example because binary discovery, marker inspection, or another optional whisper status dependency fails—the exception escapes directly into run_chained_update(), which marks the whole combined job as an error with whisper.cpp update failed. The initial probe is deliberately protected by _whisper_chain_status() so whisper cannot break a llama update, but this newly added direct call bypasses that guard; catch probe failures here and return a skipped result so an optional recheck cannot turn an already successful llama replacement into a failed job.
Useful? React with 👍 / 👎.
| is reported as a skip carrying the plan's reason, so the phase breakdown reads the | ||
| same as it did when the decision was made before the job started. | ||
| """ | ||
| plan = chained_phase_plan(force_refresh = True, paired_llama_will_update = False) |
There was a problem hiding this comment.
Reuse the macOS compatibility result during the recheck
On macOS, this forced chained_phase_plan() call runs the host resolver once inside get_update_status() to choose the compatible release and then runs it again at the slim-pairing gate because force_refresh=True bypasses the memo both times. Besides adding another potentially 60-second subprocess after llama finishes, a transient failure of only the second call returns paired_llama_unavailable and skips installation while leaving the first successful resolver result cached; the next non-forced status poll reuses that cached result, reports whisper behind, and raises the exact second banner this change is intended to prevent. Reuse the resolver payload from the status calculation rather than forcing a second independent probe.
Useful? React with 👍 / 👎.
|
Closing this: the reason I gave for it does not hold. I claimed a llama update can newly expose a whisper update, which is what produced the second banner. It cannot. whisper_cpp_freshness carries no reference to llama at all, so whisper's update_available is a straight comparison of the installed tag against the latest whisper release, and a llama update cannot flip it from up_to_date to behind. In the both-behind case the existing code already chains whisper correctly, since the slim pairing gate is deliberately skipped when llama is updating. The sequence described in the body does not occur. There is a real defect underneath, but it is a different one: when llama updates to a build with no paired whisper release, the plan skips the pairing gate on the grounds that the llama phase will supply a workable pairing, the whisper phase then attempts an install that cannot succeed, the installer exits 2, and the whole job reports failure after llama already landed. That is the state the pipeline was in while whisper stayed on b10472-mix-4b653db through four llama releases. Reopening that as a narrow change that does only the pre-flight, rather than the re-planning this PR grew into. |
The two popups
routes/llama.pycalls itself "the single main update item" andPOST /api/llama/updatereally does chain a whisper phase. In practice you can still get two popups in a row, one for llama.cpp and then one for whisper.cpp.The cause is ordering. The job plans every phase before any of them runs:
So whisper is judged against the llama build that is about to be replaced. A llama update that is itself what makes a newer whisper available, or what first makes one pairable, is invisible at that moment. The job finishes, the next poll sees whisper behind, and
update_componentflips:The frontend reads that single value straight into its label, so the same banner reappears naming whisper.cpp seconds after the llama one.
dismiss()is onlysetVisible(false)with no memory of which component was dismissed, so closing the first does nothing about the second.The change
Re-plan whisper once the new llama is in place and run it in the same job, instead of leaving it for the next poll to raise a banner about.
paired_llama_will_updateisFalseby then, because it already did, so the plan consults the installer's read-only resolver and skips cleanly when no compatible whisper release exists rather than attempting an install that cannot succeed. That matters: the old code assumed the new llama would always supply a workable pairing, and the comment said so, but that assumption is exactly what failed while whisper stayed pinned tob10472-mix-4b653dband llama shippedb10639,b10672,b10679andb10687.Behaviour after this change matches the rule the update item was written for:
Two things it deliberately preserves
Skip reasons survive. A phase can now report a skip from its result, not only from its plan, so the breakdown still reads
skipped: up_to_dateorskipped: local_linkrather than degrading into a success with an empty message. Deciding later must not mean explaining less. Without this,test_apply_llama_only_when_whisper_currentandtest_apply_skips_whisper_local_link_silentlyboth broke, and they were right to.The fail-open holds. The re-check is scheduled only when the probe actually produced a plan. An empty one means the piggyback is disabled or the probe failed, and re-importing the module there would undo the guard that keeps a broken whisper from taking a llama update down with it.
test_llama_update_survives_unavailable_whisper_modulecatches exactly that, and caught it here.Tests
paired_llama_will_update = Falseandforce_refresh = True, then installsup_to_date,paired_llama_unavailable, and a plan that claims an update but carries no phase, reporting a skip with the reason in each casetest_combined_update.pyandtest_llama_backend_switch.pyare 64 passed, and the wider update surface is 3847 passed. One unrelated failure,test_mlx_repair.py::test_install_requires_prebuilt_wheels, fails identically without this branch: it is a localhuggingface-hubversion mismatch, not a code defect.Not in this PR
When both are behind, the banner still says only
llama.cpp, even though the apply covers whisper too. Naming the union would mean changingupdate_componentfrom a singleLiteral["llama", "whisper"]into something the frontend can render as both, which touches the status shape, the hook and the component. It is worth doing, but it is a separate change and it is cosmetic: with this fix the second popup is gone either way.