Repository navigation
fix(ui): classify chat helper models with the shared cloud catalog - #6926
Conversation
|
Verdict: Approve with suggestions The fix is correct. Chat titling, the slot-wait check, the empty-answer diagnosis and the pre-turn context check now recognize cloud models that GAIA only learns about at runtime (like
Real-world evidenceN/A: no evidence bundle was produced for this run. The change is internal model classification with no new CLI, API or UI surface. The verdict rests on static review and the author's unit-test results. I couldn't re-run the tests here because pytest isn't installed on this runner. 🔍 Technical detailsIssues 🟡 Follow-up: "Route remaining UI cloud checks through the shared catalog". These callers outside the diff still call
(This would go in Notes
Strengths
|
Summary
Six cloud-model checks in
src/gaia/ui/_chat_helpers.pynow use the existing_ui_cloud_provider, which also reads the shared model catalog. Before, a cloud model from a provider GAIA only learns about at runtime, likeopencode.*, counted as local in those places.Why
The review on #6907 pointed out these call sites. They called
cloud_model_provider(model_id)with no metadata, which only recognizes thefireworksandamdprefixes. The module already has_ui_cloud_providerfor this, and other callers in the file use it.The most important one is
_title_model_for. It exists so "a local chat's content never leaves the PC just to name it." With a guard model as the session model and a runtime-discovered cloud model as the default, that check missed the cloud default, so a local chat could be sent to it just to generate a title.Linked issue
Refs #4784, which #6907 fixes in
LemonadeClient. This PR is independent of #6907 and doesn't touchlemonade_client.py.Changes
These call sites now use
_ui_cloud_provider(model_id):_title_model_for: both the title model and the session model._generate_session_title: the local/cloud switch for title request options._title_when_model_free: whether to wait for a local slot._maybe_update_session_title: whether to title at turn start._empty_answer_backend_problem: whether to check that the model is loaded locally.recipe, and now uses the same helper as the rest.The PR also removes the
cloud_model_providerimports those functions no longer need.Test plan
Run in a
python:3.12-slimcontainer with.[ui]and the test tools installed:pytest tests/unit/chat/ui/test_chat_helpers.py tests/unit/chat/ui/test_chat_title_on_send.py tests/unit/chat/ui/test_model_slot_discipline.py: 231 passed.python util/lint.py --all: passes, with the existing mypy warning count.pytest tests/unit: 34 failures, but 17 test workers crashed under load. The 20 test files with failures thatmaindidn't have pass when rerun on their own (1,967 passed). Most of the other failures also fail onmainin my environment.With the source change reverted, both new tests fail:
Evidence
The two new tests cover the title-model privacy check and the empty-answer diagnosis, with a model known only from the catalog (
opencode.big-model). Without the fix, the guard chat gets titled by that cloud model, and the diagnosis checks whether it's loaded locally. With the fix, both treat it as cloud. The other changed call sites use the same helper, and their existing tests pass.Not tested against a real cloud provider or a running Agent UI.
Checklist
Closes #N/Fixes #N/Refs #N).python util/lint.py --all,pytest tests/unit/).