When a backend's *_bin is pinned to "latest", loading a model resolves the
newest release tag from GitHub. If that lookup fails (e.g. HTTP 504) or is
otherwise unreachable, resolution threw and the model refused to load — even
though a perfectly usable binary was already installed (lemonade-sdk#2265).
Mirror the existing offline behavior for the live-failure case: when the
"latest" lookup cannot be satisfied, fall back to the version recorded in the
installed binary's version.txt and load with a warning, instead of throwing.
Only error when neither a live tag nor an installed binary is available. This
applies to every backend resolved through resolve_user_version() (llamacpp,
whisper, sd, kokoro, …) pinned to "latest", not just llamacpp:vulkan.
The fallback decision is extracted into a pure, I/O-free helper
(lemon::resolve_latest_pin) so the policy can be unit-tested in isolation;
resolve_user_version() now gathers the inputs (live lookup + installed
version.txt) and applies the result. Adds a standalone C++ unit test covering
the full decision table (online ok / online failed / offline, with and without
an installed binary), wired into CMake + CI alongside the existing watcher test.
The test uses explicit pass/fail accounting (not assert(), which the Release
build's -DNDEBUG would compile away) so it remains effective in CI.
Scoped to the "latest" resolution path only: pinned/builtin/path/bare-tag
values and unrelated load errors are unchanged.
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: glm-5.2 <[email protected]>
Co-authored-by: GPT-5.5 <[email protected]>