Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(model-hub): let an agent's provider rows follow the Source tiers the startup reconcile derives again (#2632)

Call Whitec0cc286a6a5c
diff --git a/core/handlers/model_hub/service.py b/core/handlers/model_hub/service.py
index 7531f8df2..84aa18492 100644
--- a/core/handlers/model_hub/service.py
+++ b/core/handlers/model_hub/service.py
@@ -6813,8 +6813,9 @@ class ModelHubService:
Rows an earlier build derived keep its rules until discovery revisits
them: 3.2.0 found no catalog row for a snapshot id and declared the whole
protocol default list for Opus 4.6. ``rederive_persisted_tiers`` decides
- which rows are derived again. The result is saved once, so a later start
- changes nothing.
+ which rows are derived again, and an agent's provider rows that still hold
+ what those rows gave follow them. The result is saved once, so a later
+ start changes nothing.
"""
async with self._mutation_lock:
@@ -6839,6 +6840,18 @@ class ModelHubService:
model.reasoning_efforts = list(resolution.efforts)
model.reasoning_efforts_source = resolution.source
changed.append((source.id, model.id))
+ if changed:
+ # A provider row in an agent's list took its tiers from its suppliers' Source rows when it was added,
+ # and a hop offers only the tiers its row lists (Vibey sends no other). A row that still holds what
+ # its suppliers gave follows them; one that holds anything else was set apart and stays.
+ for backend, agent in config.agents.items():
+ for row in agent.models:
+ if row.origin != "provider":
+ continue
+ before = self._candidate_suppliers(previous, backend, row.id)[2]
+ after = self._candidate_suppliers(config, backend, row.id)[2]
+ if after != before and list(row.reasoning_efforts) == before:
+ row.reasoning_efforts = after
if changed and self._reconcile_store_writable():
await self._commit_synced(previous, config)
return changed
diff --git a/docs/plans/model-hub-reasoning-tiers.md b/docs/plans/model-hub-reasoning-tiers.md
index 25d7ff455..b763b2c2d 100644
--- a/docs/plans/model-hub-reasoning-tiers.md
+++ b/docs/plans/model-hub-reasoning-tiers.md
@@ -66,7 +66,10 @@ shape and treats everything else as "not carried":
startup (`ModelHubService.reconcile_source_reasoning_tiers`): every `catalog`
or `upstream` row, or a row with no source and no tiers, whose model has a
catalog row. A user's list waits for the next discovery, which records the
- override event.
+ override event. An agent's provider row that still holds the tiers its
+ suppliers gave follows them (#2629): a hop offers only the tiers its row
+ lists, and Vibey sends no other. A row that holds anything else, and a
+ typed one, stays.
- Any other/unknown metadata shape → rung 1 does not apply. No guessing from
model-id patterns (family inference was explicitly deferred; wrong claims
turn into upstream 400s).
diff --git a/tests/fixtures/model_hub/released_3_2_0_source_tiers.json b/tests/fixtures/model_hub/released_3_2_0_source_tiers.json
index 943d4a343..e97d22180 100644
--- a/tests/fixtures/model_hub/released_3_2_0_source_tiers.json
+++ b/tests/fixtures/model_hub/released_3_2_0_source_tiers.json
@@ -788,6 +788,55 @@
}
],
"removed_model_ids": []
+ },
+ "vibey": {
+ "backend": "vibey",
+ "mode": "hub",
+ "menu_kind": "fixed",
+ "sources": {
+ "order": [
+ "src_tiers3201",
+ "src_tiers3202"
+ ]
+ },
+ "routes": {},
+ "menu": null,
+ "models": [
+ {
+ "id": "gpt-6-astra-2026-09-01",
+ "origin": "provider",
+ "display_name": null,
+ "reasoning_efforts": []
+ },
+ {
+ "id": "claude-opus-4-6",
+ "origin": "provider",
+ "display_name": null,
+ "reasoning_efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ]
+ },
+ {
+ "id": "claude-sonnet-4-6-20260301",
+ "origin": "provider",
+ "display_name": null,
+ "reasoning_efforts": [
+ "low",
+ "high"
+ ]
+ },
+ {
+ "id": "relay-house-model",
+ "origin": "manual",
+ "display_name": null,
+ "reasoning_efforts": []
+ }
+ ],
+ "removed_model_ids": []
}
}
}
diff --git a/tests/test_model_hub_reasoning_tiers.py b/tests/test_model_hub_reasoning_tiers.py
index 5dc1e482e..0f2cd0153 100644
--- a/tests/test_model_hub_reasoning_tiers.py
+++ b/tests/test_model_hub_reasoning_tiers.py
@@ -207,7 +207,8 @@ def test_a_persisted_catalog_list_offers_no_client_preset_to_vibey(tmp_path, pro
@pytest.mark.asyncio
async def test_rows_saved_by_3_2_0_are_derived_again_once_at_startup(tmp_path) -> None:
"""MH-HOSTED-006: 3.2.0 found no row for a snapshot id and declared xhigh for Opus and Sonnet 4.6. The fixture
- was written by v3.2.0's own ladder; the startup reconcile derives those rows again, and only those."""
+ was written by v3.2.0's own ladder; the startup reconcile derives those rows again, and only those, and an agent's
+ rows that took their tiers from them follow (#2629)."""
import json
from pathlib import Path
@@ -243,5 +244,13 @@ async def test_rows_saved_by_3_2_0_are_derived_again_once_at_startup(tmp_path) -
("src_tiers3201", "claude-sonnet-4-6-20260301"),
("src_tiers3202", "gpt-6-astra-2026-09-01"),
]
+ # Vibey sends only the tiers its own row lists: a row that still holds what its suppliers gave follows them.
+ assert {row.id: row.reasoning_efforts for row in store.load().agents["vibey"].models} == {
+ "gpt-6-astra-2026-09-01": ["low", "medium", "high", "xhigh", "max"],
+ "claude-opus-4-6": ["low", "medium", "high", "max"],
+ # A list its suppliers never gave was set apart, and a typed row is the user's.
+ "claude-sonnet-4-6-20260301": ["low", "high"],
+ "relay-house-model": [],
+ }
# Saved once: the next start finds nothing to change.
assert await service.reconcile_source_reasoning_tiers() == []