Repository navigation
fix(ui): refuse a collection.* router model as the Custom model ID - #7548
Conversation
|
Verdict: Request changes The fix is right. With Local only on, the save-time check now uses the same allowlist as the per-turn guard, so a router collection that could forward to the cloud can no longer be saved as the Custom model ID. One thing needs fixing before merge: the new refusal doesn't say why the model was blocked.
Real-world evidenceN/A: no evidence bundle was produced for this run. The PR leaves its own live Agent UI check unchecked. The verdict rests on reading the code. The new behaviour is covered only by unit tests against the 🔍 Technical details🟡 The new 409 drops the reason the per-turn guard gives (
Please add a test for a dotted id that isn't in the catalog, so the changed behaviour for unlisted names is pinned. 🟢 Two catalog reads per ambiguous save (
🟢 The Settings save path isn't tested with a collection
Checked: Strengths
|
Summary
With Local only on, the settings page saved a
collection.*router model as the Custom model ID, and the failure only surfaced when the next message was refused. The save-time check now applies the same allowlist the per-turn guard uses, so a router collection is refused at save time.Why
A router collection can forward requests to a cloud member, so Local only cannot vouch for it, but the old save-time check only refused ids the model list marks
recipe == "cloud". Acollectionrecipe passed, leaving Settings showing a model that could never answer beside "Local only: On".Linked issue
Fixes #7525
Changes
refuse_blocked_cloud_modelinsrc/gaia/ui/routers/providers.pynow also refuses when Lemonade's catalog does not confirm every listed recipe runs on this PC (recipes_confirm_local(recipes_in_catalog(...))), the rule the per-turn guard already uses.collection.x,COLLECTION.X, anduser.collection.x; the shared custom-model fixture now carries the recipe a real catalog entry has.Test plan
python -m pytest tests/unit/chat/ui/test_providers_router.py -k "local_only or router_collection": 22 passed. The 3 new router-collection cases fail on main and pass here.python -m pytest tests/unit/chat/ui/test_server.py tests/unit/chat/ui/test_providers_router.py tests/unit/test_local_only.py tests/unit/test_local_only_paths.py tests/unit/test_cloud_model_unavailable_message.py: 539 passed, 1 skipped.python -m blackandisort --check-onlyon both changed files: clean.collection.xas the Custom model ID with Local only on and confirm it is refused.Evidence
POST /api/providers/select, and the settings save path throughrefuse_blocked_cloud_model).Checklist
Fixes #7525).python -m black,isort,pyteston the affected files).