From fb04333d4576d04fd3a1f7c68e494b8ac3290aa3 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Tue, 10 Mar 2026 12:47:24 -0400 Subject: [PATCH] Fix LLM provider resolution to use model catalog before default fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When no explicit provider is set on a request, resolve_provider now consults the model catalog (e.g. gpt-5.4 → openai) before falling back to the client's default provider. This fixes PR description generation sending cross-provider model IDs to the wrong provider. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/crates/arc-llm/src/client.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/crates/arc-llm/src/client.rs b/lib/crates/arc-llm/src/client.rs index 2d62684bd..8ec45f146 100644 --- a/lib/crates/arc-llm/src/client.rs +++ b/lib/crates/arc-llm/src/client.rs @@ -134,9 +134,13 @@ impl Client { /// Resolve the provider for a request. fn resolve_provider(&self, request: &Request) -> Result, SdkError> { + let catalog_provider = + crate::catalog::get_model_info(&request.model).map(|info| info.provider); + let provider_name = request .provider .as_deref() + .or(catalog_provider.as_deref()) .or(self.default_provider.as_deref()) .ok_or_else(|| SdkError::Configuration { message: "No provider specified and no default provider set".into(),