resolver: canonical family name exhausts both match steps before any alias is tried - #74
Merged
Brian Krabach (bkrabach) merged 1 commit intoSep 7, 2026
Conversation
… any alias
`provider: openai` resolved to the ChatGPT subscription on a host with six
provider-openai instances configured, the best at priority 2.
Cause: find_provider_by_type ran step 1 (match by key) for EVERY accepted
name before running step 2 (match by module type) for any. The openai
instances are keyed by instance id (sol, terra, luna, ...), so `openai` missed
by key; `openai-chatgpt` -- one instance, keyed by its bare type -- HIT by key
and returned, before step 2 ever resolved `openai` through the mount plan.
"Canonical first within each step" is not "canonical first".
Fix: each accepted name gets both steps before the next name is tried.
Verified against the reporting host's real settings.yaml:
BEFORE provider: openai -> openai-chatgpt (provider-openai-chatgpt, priority 17)
AFTER provider: openai -> terra (provider-openai, priority 2)
Two tests: the exact production shape (instance-id-keyed canonicals + a
bare-type-keyed alias -> canonical wins at best priority), and the case the
alias exists for (no canonical anywhere -> alias still resolves). 601 -> 603.
Generated with Amplifier
Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Brian Krabach (bkrabach)
deleted the
fix/alias-canonical-exhausts-both-steps
branch
September 7, 2026 20:31
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.
provider: openairesolved to the ChatGPT subscription on a host with sixprovider-openaiinstances configured, the best at priority 2. Found live on the reporting host right after #71/#322 landed.Cause
find_provider_by_typeran step 1 (match by key) for every accepted name before running step 2 (match by module type) for any. The openai instances are keyed by instance id (sol,terra,luna, …), soopenaimissed by key;openai-chatgpt— one instance, keyed by its bare type — hit by key and returned, before step 2 ever resolvedopenaithrough the mount plan."Canonical first within each step" is not "canonical first".
Fix
Each accepted name gets both steps before the next name is tried. Verified against the reporting host's real
settings.yaml:Priority within a module type was already honored (step 2's tie-break); this makes the family preference hold across avenues too, so the result matches what "lowest number wins" would give on this config.
Tests (601 → 603)
ruff clean · 48 root tests.