fix(dispatcher): container slot preempts composite registry binding (cutover routing)#676
Merged
Conversation
Final cutover (#662) wiring gap. The model registry binds every registered id — including models a container slot serves — to the synthetic composite `hal0` upstream, which forwards to lemonade. dispatch() step 1 (registry) short-circuited there, so hal0/* requests for a container-backed model (e.g. qwopus3.6-27b-v2 served by the `chat` container on :8102) routed to lemonade and 404'd, even though the container advertised the id and was healthy. Add step 0: a loaded container remote (kind="remote" + slot_name) that advertises the requested model wins over the registry/composite binding — a running container slot is authoritative for its model. Only fires on a warm cache hit for a container remote; lemonade-only models are untouched (added a guard test). Down container → existing readiness gate returns slot.loading 503 rather than silently serving from lemonade. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The final wiring gap surfaced by the #662 live cutover: container slots never actually receive traffic.
The model registry binds every registered id — including models served by a container slot — to the synthetic composite
hal0upstream (which forwards to lemonade).dispatch()step 1 (registry lookup) resolves there and returns before the container remote is considered. Sohal0/chat→qwopus3.6-27b-v2→ composite → lemonade → 404 (lemond can't load it), even though thechatcontainer on :8102 advertises the id and is healthy. Confirmed live via/api/upstreams: compositehal0and remotechatboth advertiseqwopus3.6-27b-v2; the composite wins.Fix
Add step 0 to
dispatch(): a loaded container remote (kind="remote"+slot_name) that advertises the requested model wins over the registry/composite binding — a running container slot is authoritative for its model.slot.loading503) instead of silently serving from lemonade.Tests
TDD:
test_container_slot_preempts_composite_registry_binding+test_non_container_model_still_uses_registry_binding. 304 passed; ruff clean.Completes the container-runtime cutover routing. Relates to #652, #662. Stacked on #674 (devices/ctx) + #675 (alias).
🤖 Generated with Claude Code