{"record":{"id":"c85f6737d7f7dc08","repo":"Hmbown/CodeWhale","slug":"active-provider-has-no-native-web-search-adapter","errorCode":null,"errorMessage":"active provider has no native web-search adapter","messagePattern":"active provider has no native web-search adapter","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/client/provider_native_search.rs","lineNumber":159,"sourceCode":"            ),\n            ApiProvider::Deepseek | ApiProvider::DeepseekCN => build_responses_search_body(\n                &self.inner.default_model,\n                request,\n                ResponsesSearchDialect::Deepseek,\n            ),\n            ApiProvider::Anthropic => {\n                let route_cap = self\n                    .inner\n                    .effective_max_output_tokens(&self.inner.default_model);\n                build_anthropic_search_body(\n                    &self.inner.default_model,\n                    request,\n                    2_048_u32.min(route_cap),\n                )\n            }\n            ApiProvider::XiaomiMimo => build_mimo_search_body(&self.inner.default_model, request),\n            ApiProvider::Zai => zai::build_body(request, &self.inner.base_url)?,\n            _ => bail!(\"active provider has no native web-search adapter\"),\n        };\n        let url = match self.inner.api_provider {\n            ApiProvider::Openai | ApiProvider::Xai | ApiProvider::ModelstudioTokenPlan => {\n                api_url(&self.inner.base_url, \"responses\")\n            }\n            ApiProvider::Deepseek | ApiProvider::DeepseekCN => {\n                responses_api_url(&self.inner.base_url, self.inner.api_provider)\n            }\n            ApiProvider::Anthropic => anthropic_messages_url(&self.inner.base_url),\n            ApiProvider::XiaomiMimo => api_url(&self.inner.base_url, \"chat/completions\"),\n            ApiProvider::Zai => api_url(&self.inner.base_url, \"web_search\"),\n            _ => unreachable!(\"provider checked above\"),\n        };\n        let body_bytes = serde_json::to_vec(&body)\n            .context(\"failed to serialize provider-native web-search request\")?;\n        let response = self\n            .inner\n            .send_with_retry(|| {","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/client/provider_native_search.rs#L141-L177","documentation":"The native web-search adapter maps each supported provider to a provider-specific request body and URL. When the active provider has no adapter entry (the `_` catch-all in the match), native search is simply not implemented for it, and the call fails with this explicit bail rather than silently degrading to a non-native path. Raised in `search` in `crates/tui/src/client/provider_native_search.rs` around line 159.","triggerScenarios":"Calling native web search while the active provider is one without a dedicated adapter (anything not Openai, Xai, ModelstudioTokenPlan, Deepseek, DeepseekCN, XiaomiMimo, Zai, and the other explicitly matched arms).","commonSituations":"Configuring a generic OpenAI-compatible endpoint or smaller provider and expecting built-in server-side web search; switching the default provider to one that lacks native search; assuming search works on all routes because it works on the big ones.","solutions":["Switch to a provider with a native search adapter (OpenAI, xAI, ModelStudio token plan, DeepSeek, Xiaomi MiMo, Z.ai).","Use the non-native search path (external search tooling) for unsupported providers.","If the provider does support server-side search upstream, implement a `build_*_search_body` adapter and URL mapping for it."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"fn has_native_search(provider: ApiProvider) -> bool {\n    matches!(provider,\n        ApiProvider::Openai | ApiProvider::Xai | ApiProvider::ModelstudioTokenPlan\n        | ApiProvider::Deepseek | ApiProvider::DeepseekCN\n        | ApiProvider::XiaomiMimo | ApiProvider::Zai)\n}","typeGuard":"fn supports_native_search(c: &Client) -> bool { has_native_search(c.api_provider) }","tryCatchPattern":"if supports_native_search(&client) {\n    client.native_search(query).await\n} else {\n    fallback_external_search(query).await // tool-based search instead of provider-native\n}","preventionTips":["Gate search features on a provider allowlist before offering the UI affordance.","Pick a provider with native search when server-side search is required.","Maintain an external search fallback for unsupported providers."],"tags":["web-search","providers","unsupported"],"backgroundTag":"operation-not-supported","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}