Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
fix(providers): the model picker stops offering Jarvis's own derived models
rubenluetke10-beep8d199c4ce2ac
diff --git a/docs/BUGS.md b/docs/BUGS.mdindex 98299dff2f..9064873de3 100644--- a/docs/BUGS.md+++ b/docs/BUGS.md@@ -14427,3 +14427,43 @@ An install that wants no local voice at all clears the fallback.**Related.** BUG-174 (the other local-models defect whose symptom was "voice onlocal models is unusably slow after a restart" — same stack, different half).++## BUG-205: the provider card offered Jarvis's own derived models as a brain, and the Local models section then called a running model "Not downloaded" (HIGH, FIXED 2026-08-28)++**Symptom.** The Ollama card's model picker listed five tags the Local models+section does not show. Choosing one — say `ornith:9b-voice-32k` — saved fine and+the model answered, but the section's chat card then read **"Not downloaded"**+about a model that was on disk and serving requests, and its picker offered no+way back to the tag that was actually configured.++**Cause.** Two surfaces derived the same list independently (the AP-4 shape,+without the parity test that pattern owes).++* The section builds from `ollama_inventory.cached_snapshot().models`, which+ drops Jarvis's OWN derived models via `is_hidden_alias`: the per-model Tune+ profiles (`<base>-jarvis-<8 hex>`) and the voice brain's bounded-context copy+ (`<base>-voice-<N>k`). Neither is a download a user chose; both are artifacts+ the app created from one.+* `GET /api/providers/{id}/models` built from the server's raw tag list. Its one+ filter, `_installed_local_models`, only knows Sherpa speech bundles and is a+ no-op for Ollama, so all five aliases reached the picker.++The "Not downloaded" line follows from there: `ollama_roles.list_roles` decides+`installed` by looking the pick up in the VISIBLE inventory+(`any(same_model(m.name, current) for m in models)`), and a hidden alias is by+construction not in it.++**Fix.** `_derived_alias_free()` in `provider_routes.py`, applied to the picker+next to the existing installed-bundle filter. It reuses `is_hidden_alias` — the+section's own function — so there is one definition of "a model a user may+pick", not two. Gated on the pull capability rather than the provider name+(AP-21): a derived alias can only exist where the app can create one.++**Guard.** `scripts/check_local_models.py` grew a `card-parity` check that fails+when either surface offers a tag the other hides, plus two unit tests in+`tests/integration/test_provider_model_routes.py`. The script is read-only and+runs on any machine, which is also how Apple Silicon and AMD get reported.++**Not changed.** A pick already saved as an alias keeps working: the brain tier+deliberately accepts a model id that is not in the catalogue, so an existing+configuration is shown rather than silently reset.diff --git a/jarvis/ui/web/provider_routes.py b/jarvis/ui/web/provider_routes.pyindex 842dbc495f..9a15b7aa31 100644--- a/jarvis/ui/web/provider_routes.py+++ b/jarvis/ui/web/provider_routes.py@@ -460,6 +460,39 @@ def _managed_server_payload(spec: ProviderSpec) -> dict[str, Any] | None:return None+def _derived_alias_free(provider_id: str, models: list[Any]) -> list[Any]:+ """Drop the runtime's OWN derived models from a user-facing picker.++ A pull-capable server holds two kinds of entry: the downloads a user chose,+ and the aliases Jarvis derived from them — a Tune profile carrying one+ model's options, the voice brain's bounded-context copy. The Local models+ section folds those away (``is_hidden_alias``); this picker did not, so the+ card offered five tags the section hides. Choosing one left the section+ reporting a model that is on disk and running as "Not downloaded", because+ it looks its pick up in the visible inventory alone.++ Gated on the pull capability rather than a provider name (AP-21): a derived+ alias only exists where the app can create one, which is exactly the set of+ servers with a native download API.+ """+ if provider_id not in _pull_capable_ids():+ return models+ try:+ from jarvis.brain.ollama_inventory import is_hidden_alias++ kept = [m for m in models if not is_hidden_alias(getattr(m, "id", ""))]+ except Exception as exc: # noqa: BLE001 — the picker must never 500+ log.debug("Alias filter for %s failed (%s); listing all.", provider_id, exc)+ return models+ if len(kept) != len(models):+ log.debug(+ "Local provider %s: hid %d derived alias(es) from the picker.",+ provider_id,+ len(models) - len(kept),+ )+ return kept++def _installed_local_models(provider_id: str, models: list[Any]) -> list[Any]:"""Drop catalog entries whose files are not on this machine.@@ -1532,6 +1565,30 @@ async def _tier_section_health()+async def provider_health(cfg: Any, provider_id: str, *, probe: bool = True) -> SectionHealth:+ """The live health of ONE named provider, for a caller outside this module.++ The same check the API-Keys tabs run, addressed by provider id instead of+ by tier: a credential that is present but rejected is ``error`` with the+ reason ("bad_key", "no_credits", …), a missing one is ``needs_setup``, a+ working one is ``ok``. The agent chat's composer uses it to say which+ seats actually answer, so the two surfaces can never disagree about+ whether a provider works — there is one check, not two opinions.++ An unknown id is ``unknown`` rather than an error: a caller listing rows+ must not lose its whole answer to one name this module has never heard of.+ """+ spec = get_spec(provider_id)+ if spec is None:+ return SectionHealth(+ status=_section_health.UNKNOWN,+ reason="unknown_provider",+ detail=f"{provider_id}: not a known provider",+ subject_id=provider_id,+ )+ return await _tier_section_health(cfg, spec, probe=probe)++def _worker_usable(provider: str) -> bool:"""Best-effort "is the selected heavy-task worker connected/keyed?".@@ -2300,7 +2357,7 @@ async def list_brain_models(# chosen — the same "offered but not there" defect as a card claiming ready# before it is installed. Filtered here rather than in the catalog so the# catalog stays the complete list a download route can work from.- models = _installed_local_models(provider_id, result.models)+ models = _derived_alias_free(provider_id, _installed_local_models(provider_id, result.models))current = _current_selection(cfg, provider_id, cat)# Safety net: for a curated TTS/STT list, never echo a value that isn't in the# list (e.g. a stale global value belonging to a different provider) — show thediff --git a/tests/integration/test_provider_model_routes.py b/tests/integration/test_provider_model_routes.pyindex 5ec50da635..35b4aa81ca 100644--- a/tests/integration/test_provider_model_routes.py+++ b/tests/integration/test_provider_model_routes.py@@ -536,3 +536,34 @@ def test_test_button_ceiling_stays_above_its_own_budget() -> None:spec = get_spec(provider_id)assert spec is not Noneassert pr._tier_test_ceiling_s(spec) > pr._tier_test_budget_s(spec)+++# ── Derived aliases: the card must offer what the section shows ──────────────+++def test_the_picker_hides_the_runtimes_own_derived_aliases() -> None:+ """A Tune profile and the voice brain's bounded-context copy are Jarvis's+ OWN models, not downloads a user chose. The Local models section folds them+ away; this picker used to offer them, and choosing one left that section+ reporting a running model as "Not downloaded" — it looks its pick up in the+ visible inventory alone."""+ from jarvis.ui.web import provider_routes as pr++ catalogued = [+ ModelInfo(id="ornith:9b", label="ornith:9b"),+ ModelInfo(id="deepseek-r1:14b", label="deepseek-r1:14b"),+ ModelInfo(id="deepseek-r1-14b-jarvis-dcf2fd1c:latest", label="tune profile"),+ ModelInfo(id="ornith:9b-voice-32k", label="voice alias"),+ ModelInfo(id="qwen3.5:4b-voice-8k", label="voice alias"),+ ]+ kept = [m.id for m in pr._derived_alias_free("ollama", catalogued)]+ assert kept == ["ornith:9b", "deepseek-r1:14b"]+++def test_a_card_that_cannot_create_an_alias_is_left_alone() -> None:+ """The filter is gated on the pull capability, not a provider name (AP-21):+ a derived alias only exists where the app can create one."""+ from jarvis.ui.web import provider_routes as pr++ catalogued = [ModelInfo(id="gpt-5-voice-8k", label="a real hosted model")]+ assert pr._derived_alias_free("openai", catalogued) == catalogued