Skip to content

Honor mounted provider account availability during routing - #77

Merged
Brian Krabach (bkrabach) merged 1 commit into
mainfrom
fix/provider-unavailable-routing
Sep 24, 2026
Merged

Brian Krabach (bkrabach) merged 1 commit into
mainfrom
fix/provider-unavailable-routing

Conversation

@bkrabach

Copy link
Copy Markdown
Collaborator

When an application retains an unavailable provider account, role routing could treat its catalog failure as “no match” and inherit a different default account. Hosts can now register a synchronous provider.check_available(instance_id) capability: routing checks the mounted account before exact models, cached catalogs, or fetched catalogs, tries only declared candidate/role fallbacks, and propagates the first failure when those are exhausted. Hosts without the capability retain legacy failure handling.

Catalogs and concurrent fetches are keyed by the mounted account, and Core instance_id takes precedence over legacy id. Lifecycle cache propagation uses preresolved_models_by_instance, so old bare-family caches cannot be mistaken for another account’s catalog. A malformed async availability callback fails immediately, without silently trying another account.

Hosts that resolve roles before each spawn/resume may opt into routing.defer_agent_resolution=True to skip unrelated eager agent scans. It is off by default; the host must implement and enforce that resolution boundary. This PR adds no host adoption, provider configuration changes, or account switching policy. See docs/PROVIDER_AVAILABILITY.md for the consumer contract.

Validation: 684 module and repository tests passed, including 27 focused availability/cache/lifecycle cases; pinned Ruff 0.15.11, bundle structure, and diff checks passed. Tests are offline with synthetic providers; real host/spawn adoption is separate. Prerequisite for microsoft/amplifier-unified#182.

@bkrabach
Brian Krabach (bkrabach) merged commit 8541929 into main Sep 24, 2026
7 checks passed
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