Repository navigation
Fix llama.cpp update banner offering a downgrade when GitHub /releases/latest lags - #6214
shimmyshimmer wants to merge 2 commits into
Conversation
…t lags The update banner decided update_available with a plain tag inequality (installed != latest). GitHub's /releases/latest endpoint sorts by the commit date of the release target, not by build number, so when fork releases land out of order it can return an older build than the one the installer just resolved from upstream. Users then saw a persistent banner like b9596 -> b9594 right after updating, which looks like a downgrade prompt and never goes away. Compare bNNNN build numbers on the prebuilt marker path (mirroring what the source-build path already did) and only offer real upgrades, with tag inequality kept as the fallback for non-bNNNN tags. Apply the same guard to the freshness stale flag so the CLI warning cannot report a downgrade either. Reported in https://www.reddit.com/r/unsloth/comments/1u34fa3/
There was a problem hiding this comment.
Code Review
This pull request introduces logic to compare numeric build numbers (e.g., bNNNN) for llama.cpp releases instead of relying solely on tag inequality. This prevents newer installed builds from being flagged as stale or offered as downgrades when GitHub's /releases/latest lags behind due to out-of-order releases. Unit tests have been added to verify this behavior. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0dff621b6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| installed_build = parse_build_number(installed) | ||
| latest_build = parse_build_number(latest) | ||
| if installed_build is not None and latest_build is not None: | ||
| behind = installed_build < latest_build |
There was a problem hiding this comment.
Avoid suppressing updates based on the lagging release tag
When /releases/latest is behind the actual newest release (the condition this change is handling), this comparison can hide real updates for users whose installed build is between the lagging tag and the true latest tag. For example, if GitHub returns b9594 while b9596 is already published and the user has b9595, behind becomes false, so get_update_status shows no banner even though the update path re-resolves --llama-tag latest and would install b9596.
Useful? React with 👍 / 👎.
|
Superseded by #6219. One heads-up: the |
|
Closing in favor of #6219, which is merged. This now conflicts with main since #6219 reworked the same two files, and the approach here does not cover the current release format: |
Summary
Fixes the "New llama.cpp prebuilt" banner offering what looks like a downgrade (for example
b9596 -> b9594) and reappearing forever after a successful update.Reported on Reddit: https://www.reddit.com/r/unsloth/comments/1u34fa3/new_llamacpp_prebuilt_b9596_b9594/
Root cause
Detection and apply use two different definitions of "latest":
studio/backend/utils/llama_cpp_freshness.py) calls GitHub's/repos/unslothai/llama.cpp/releases/latest. GitHub sorts that endpoint by thecreated_atof the commit the release targets, not by publish time or build number. Our fork's automated releases share or jumblecreated_attimestamps (several current releases have the identical commit date), so when builds are published out of order or rebuilt, the endpoint can return a lower build (b9594) even thoughb9596is already released.install_llama_prebuilt.py --llama-tag latest, which resolves against upstreamggml-org/llama.cpp/releases/latestand scans fork releases by publish time, correctly installing the newest build (b9596).The banner then decided
update_availablewith a plain inequality inget_update_status:So after a legitimate update to
b9596, the marker (b9596) never equals the lagging detection tag (b9594), and the banner reappears rendered as a downgrade arrow. The source-build path already compared build numbers (installed_build < latest_build); the prebuilt marker path did not.Fix
parse_build_number()tollama_cpp_freshness.py(strictbNNNNmatch).get_update_statusnow compares build numbers on the marker path and only reportsupdate_availablefor real upgrades. Tag inequality is kept as the fallback when either tag is notbNNNNshaped.check_prebuilt_freshnessapplies the same guard so thestaleflag (and the CLI stale warning) cannot report a downgrade either.Clicking Update in the affected state was already harmless (the installer re-resolves latest itself and reinstalls the newest build), so this is purely a detection and UI fix.
Tests
New regression tests:
test_status_installed_newer_than_latest_release_not_offered(installedb9596, latestb9594, no banner)test_status_non_numeric_tags_fall_back_to_inequalitytest_check_prebuilt_freshness_not_stale_when_installed_newertest_parse_build_numberNote:
test_start_update_installer_failure_reports_errorandtest_update_clears_maintenance_flag_on_installer_failurefail on main when the two files run in the same pytest invocation (pre-existing cross-file pollution, unrelated to this change); each file passes cleanly on its own.