Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(api): advertise all enabled llm slots in discovery, not just loaded ones#1153

Merged
thinmintdev merged 4 commits into
mainfrom
fix/discovery-cold-slot-visibility
Jul 6, 2026
Merged

fix(api): advertise all enabled llm slots in discovery, not just loaded ones#1153
thinmintdev merged 4 commits into
mainfrom
fix/discovery-cold-slot-visibility

Conversation

@thinmintdev

Copy link
Copy Markdown
Contributor

Problem

Both hal0_slot_alias_models (/v1/models catalog) and _collect_chat_slots (Hermes provision) filtered to only warm slots — but dispatch already cold-loads on demand when a request addresses a cold slot by alias. This mismatch hid code, nano, and other cold chat slots from both Hermes and pi-coder, even though addressing them by name would auto-load them.

Root cause: the "only advertise what's loaded" rule was written before the alias dispatch path gained cold-start loading. The alias map (hal0_chat_slot_alias_map) already included every enabled llm slot with a model — including cold ones. Only discovery lagged behind.

Fix

Two surfaces, same rule — advertise every enabled type=="llm" slot with a configured model, same criteria as hal0_chat_slot_alias_map:

  • hal0_slot_alias_models: removed the _loaded_model_ids helper and the model_id not in loaded filter
  • _collect_chat_slots: removed the _is_ready() gate

Tests

  • 4 API slot-alias tests updated
  • 4 Hermes provision-collect tests updated
  • Full suite: 99 pass (11 slot-alias/hermes-collect + 88 hermes_provision)

…ed ones

Both hal0_slot_alias_models (/v1/models) and _collect_chat_slots (Hermes
provision) filtered to only warm slots — but dispatch already cold-loads
on demand when a request addresses a cold slot by alias. This mismatch
hid code, nano, and other cold slots from both Hermes and pi-coder even
though addressing them by name would auto-load them.

Removes the loaded-model-id check from hal0_slot_alias_models (and the
now-unused _loaded_model_ids helper) and the _is_ready filter from
_collect_chat_slots. Both surfaces now advertise every enabled llm slot
with a configured model — same criteria as hal0_chat_slot_alias_map.

Tests: 11 slot-alias/hermes-collect tests pass; 88 hermes_provision pass.
The canonical hal0/agent, hal0/utility, hal0/npu live-resolve virtual
names were injected into /v1/models alongside the per-slot alias entries,
creating duplicate model entries for the same slots. Since the slot
aliases (agent, utility, npu, etc.) are now discoverable via
hal0_slot_alias_models, the separate live-resolve advertisement is
redundant.

Dispatch still resolves the canonical names — this only removes them
from the discovery catalog. Hermes uses model.default: "hal0/agent" in
its config, which routes through the dispatch LiveSlotResolver, not
through model discovery.
@thinmintdev thinmintdev merged commit 7333a26 into main Jul 6, 2026
2 of 3 checks passed
@thinmintdev thinmintdev deleted the fix/discovery-cold-slot-visibility branch July 6, 2026 10:11
thinmintdev added a commit that referenced this pull request Jul 8, 2026
Python:
- Rewrite test_virtual_models.py: list_models no longer uses
  _normalize_slot_views/_normalize_loaded_models (PR #1153).
  Inject slot_manager + model_registry on app.state instead.

Playwright (settings-reorg #1163 fallout):
- settings-v3.spec.ts: 10→11 sections, default now General not Secrets
- settings-default-slots-v3.spec.ts: /#settings/defaults→/#settings/slots
- hf-token-setting.spec.ts: click Secrets nav before finding HF_TOKEN field
- ui-sweep-a-v3.spec.ts: navigate to Secrets for AddSecretModal test;
  rewrite GeneralSection test for new content
- data.jsx: add mem_mb to all live slots so memory-map model can attribute
  per-slot (was falling back to even-GTT-split → only 1 distinct swatch)
thinmintdev added a commit that referenced this pull request Jul 8, 2026
* fix(tests): repair CI failures post-settings-reorg (#1163) & PR #1153

Python:
- Rewrite test_virtual_models.py: list_models no longer uses
  _normalize_slot_views/_normalize_loaded_models (PR #1153).
  Inject slot_manager + model_registry on app.state instead.

Playwright (settings-reorg #1163 fallout):
- settings-v3.spec.ts: 10→11 sections, default now General not Secrets
- settings-default-slots-v3.spec.ts: /#settings/defaults→/#settings/slots
- hf-token-setting.spec.ts: click Secrets nav before finding HF_TOKEN field
- ui-sweep-a-v3.spec.ts: navigate to Secrets for AddSecretModal test;
  rewrite GeneralSection test for new content
- data.jsx: add mem_mb to all live slots so memory-map model can attribute
  per-slot (was falling back to even-GTT-split → only 1 distinct swatch)

* fix: ruff format test_virtual_models.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant