Skip to content

fix: exclude internal providers from routing_preferences model validation#880

Open
octo-patch wants to merge 2 commits intokatanemo:mainfrom
octo-patch:fix/issue-645-exclude-internal-models-from-routing-validation
Open

fix: exclude internal providers from routing_preferences model validation#880
octo-patch wants to merge 2 commits intokatanemo:mainfrom
octo-patch:fix/issue-645-exclude-internal-models-from-routing-validation

Conversation

@octo-patch
Copy link
Copy Markdown

Fixes #645

Problem

The routing_preferences validation in init_app_state built the set of valid model names from all model providers, including internal ones (arch-router, arch-function, plano-orchestrator). This meant a user could accidentally reference an internal provider in routing_preferences.models, which would pass validation but then route requests to an internal model — producing undefined behavior.

Solution

Added a .filter(|p| p.internal != Some(true)) step when building provider_model_names during routing_preferences validation. Internal providers are now excluded from the set of valid routing targets, consistent with how LlmProviders::to_models() and IntoModels for Vec<LlmProvider> already filter them out when listing models.

Testing

All existing lib tests pass (cargo test --lib):

  • brightstaff: 150 passed, 0 failed
  • common: 36 passed, 0 failed

octo-patch added 2 commits April 8, 2026 12:51
Fixes katanemo#643

Move request_id and traceparent initialization to the start of
on_http_request_headers so that all subsequent log messages within
the same handler (including select_llm_provider) carry the correct
request ID instead of showing 'no_request_id'.
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.

if default model is not specified don't include internal models for random selection

1 participant