Repository navigation
fix(llm): a Lemonade server below the version floor is actually reported - #4632
Conversation
A Lemonade Server older than GAIA supports passed the version check: the client computed the verdict and both callers threw it away, and an unknown or unparseable version returned "compatible". - _check_version_compatibility raises LemonadeVersionError below the floor, naming the found and required versions and `gaia init --force-reinstall`; initialize() reports it on the status and refuses to start a too-old server. An unknown version now warns. - The floor is defined once in gaia.version: init profiles and the flagship sidecar reference it, and the sidecar uses the core version_meets_min instead of its own parser. The frozen email sidecar keeps its vendored copy, now held to the core floor by a test. - get_status logs a failed catalog lookup instead of hiding it. - Removes the unused LemonadeClient.ready() and the __main__ demo.
|
Verdict: Approve with suggestions This makes a Lemonade Server below GAIA's minimum version an actual error. Before, the check was computed and thrown away, and an unreadable version counted as "fine". Now the error names both versions and the fix (
Real-world evidenceN/A — no evidence bundle was produced for this run. The only runnable surfaces are the SDK setup call and the flagship's 🔍 Technical detailsIssues 🟡 Version gate doesn't reach the main CLI path ( 🟡 🟢 Narrowed 🟢 Redundant local Strengths
|
|
The CLI startup path stays out of this PR, and the description already scopes the fix to the SDK setup call and the flagship's 🔍 Technical details
|
… point (amd#4657) Right after `gaia init`, if GAIA's own Lemonade is stopped (after a reboot, a crash, or `gaia lemonade embedded stop`), `gaia llm`, `gaia chat`, `gaia api`, every agent constructor, the TUI and `initialize_lemonade()` look for a system Lemonade. They find none and tell the user to run the `gaia init` they already ran. Only the Agent UI server started the right one. Now every start path checks one resolver and starts GAIA's server through the daemon. If that start fails, the daemon's error is shown and nothing tries a system install. <details> <summary>🔍 Technical details</summary> - **Cause.** `ensure_ready` only started the embedded server when the caller pinned no URL. The CLI pins env host and port, and the Agent base pins the URL it resolved while the server was stopped. Both fell through to `/daemon/v1/lemonade/start`, whose `LemonadeSupervisor` only knows `resolve_lemonade()`. `LemonadeClient.initialize` / `launch_server` resolved the system launcher directly. - **Fix.** `gaia_runs_lemonade(base_url)` in `lemonade_launcher.py` is the single decision. It is true when the embedded server is installed, `LEMONADE_BASE_URL` is unset, and the URL is unset or is the one GAIA resolves on its own. `ensure_ready`, the supervisor (now given the daemon's `EmbeddedLemonadeOwner`), `launch_server`, `_check_lemonade_installed`, `start_embedded_if_stopped` and `describe_start_hint` all go through it. The embedded server binds a random port, so `ensure_ready`, the Agent base and `launch_server` re-resolve after starting it. - **Not a start path.** `AgentSDK` construction never starts a server; its first request fails with the provider's client hint. - **Overlap.** This conflicts textually with amd#4618 in `LemonadeClient._check_lemonade_installed`, where both add an "embedded counts as installed" check. Either can merge first; on rebase keep this PR's `gaia_runs_lemonade(self.base_url)` line and amd#4618's message changes. It doesn't touch the functions changed by amd#4627, amd#4632 or amd#4543. </details> ## Test plan - [x] `pytest tests/unit/test_gaia_lemonade_start_path.py` covers the cold state: embedded installed and stopped, no system Lemonade. The tests patch only the daemon, HTTP, `Popen` and the launcher resolver. Each case asserts the daemon started GAIA's server, the system launcher was never consulted, nothing was spawned, and the caller ended up on the new port. Cases: CLI, Agent base, UI server, `initialize_lemonade`, `create_lemonade_client`, the daemon supervisor, and failure paths. - [x] Related suites pass: `test_lemonade_manager_autostart`, `test_lemonade_supervisor`, `test_lemonade_launcher`, `test_lemonade_service`, `test_daemon_lemonade`, `test_daemon_lemonade_routes` - [ ] On a machine with only `gaia init`'s Lemonade: `gaia lemonade embedded stop`, then `gaia llm "hi"` answers instead of saying Lemonade is not installed - [ ] Same state, TUI: the model server comes up without a "could not find one to start" error Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Kalin Ovtcharov <[email protected]>
If your Lemonade Server was older than GAIA supports, the Lemonade client's setup call (
initialize()/initialize_lemonade()) didn't tell you. It computed the verdict, but both callers threw it away, and a version it couldn't read counted as "compatible". Now a server below the floor produces an error that names the installed version, the required one, andgaia init --force-reinstall, and the client won't start a server it already knows is too old. A version it can't read now triggers a warning. The flagship's/initreadiness check (what the TUI preflight shows) now gives the same fix.10.2.0is now defined only ingaia.version. Thegaia initprofiles and the flagship's/initcheck both use it, and the flagship uses the shared version comparison instead of its own copy. The frozen email sidecar keeps its deliberate copy (it can't import core), and a new test holds that copy to the core floor.get_statusnow logs a warning instead of silently showing loaded models with no labels. The unusedLemonadeClient.ready()and the__main__demo block are deleted.LemonadeClient.ready()is removed; callhealth_check()instead. The CLI startup path (LemonadeManager.ensure_ready) does not check the floor yet; that is a follow-up.Test plan
tests/unit/test_lemonade_version_check.pycovers the too-old error and its message, refusing to start a too-old server, the warning for an unreadable version, the supported path, and the logged catalog failurehub/agents/gaia/python/tests/test_init_version_floor.py:/v1/gaia/initreturns 503 with the fix in the hint for an old server, still accepts CalVer dev builds, and shows an unreadable version as unknowntests/unit/test_lemonade_calver.pychecks that the flagship uses the shared check and that the email sidecar's floor matches corepytest tests/unit hub/agents/gaia/python/tests -k "lemonade or init_command or readiness or calver or server or installer"withGAIA_HOMEandGAIA_DAEMON_HOMEpointed at fresh temp dirs: the only 3 failures also fail onmainor depend on pip/networkpython -c "from gaia.llm.lemonade_client import initialize_lemonade; print(initialize_lemonade(auto_start=False).error)"prints both versions andgaia init --force-reinstall