fix: show search provider in doctor output#2135
Open
nanookclaw wants to merge 1 commit into
Open
Conversation
Signed-off-by: Nanook <nanookclaw@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request implements a centralized search provider resolution mechanism that supports environment variable overrides via DEEPSEEK_SEARCH_PROVIDER, configuration file settings, and defaults. It introduces the SearchProviderSource and SearchProviderResolution types to track how a provider was selected and updates the doctor diagnostic command to report this information. Existing logic in the TUI and runtime components has been refactored to use these new methods, and extensive unit tests have been added to verify the resolution priority and diagnostic output. I have no feedback to provide.
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.
Summary
Closes #2131.
This adds active search provider reporting to
codewhale doctorso users can see which backendweb_searchwill use and where that choice came from. Text output now printssearch_provider: <provider> (source: <source>), anddoctor --jsonincludes a structuredsearch_providerobject withproviderandsourcefields.The provider selection is resolved in one place so doctor output matches runtime behavior:
DEEPSEEK_SEARCH_PROVIDERtakes precedence over[search] provider, which takes precedence over the default Bing provider. When Bing is only the default, the text output includes a short hint showing how to switch to DuckDuckGo, Tavily, or Bocha. API key handling is intentionally unchanged here; this PR only addresses the provider/source visibility requested by the issue.Verification:
cargo fmt --checkcargo test -p codewhale-tui doctor_endpoint_tests::doctor_search_provider -- --nocapturecargo test -p codewhale-tui config::tests::search_provider_resolution -- --nocapturecargo check -p codewhale-tuicargo run -q -p codewhale-tui -- doctor --jsonDEEPSEEK_SEARCH_PROVIDER=tavily cargo run -q -p codewhale-tui -- doctor --json