Skip to content

fix: show search provider in doctor output#2135

Open
nanookclaw wants to merge 1 commit into
Hmbown:mainfrom
nanookclaw:fix/doctor-search-provider
Open

fix: show search provider in doctor output#2135
nanookclaw wants to merge 1 commit into
Hmbown:mainfrom
nanookclaw:fix/doctor-search-provider

Conversation

@nanookclaw
Copy link
Copy Markdown

Summary

Closes #2131.

This adds active search provider reporting to codewhale doctor so users can see which backend web_search will use and where that choice came from. Text output now prints search_provider: <provider> (source: <source>), and doctor --json includes a structured search_provider object with provider and source fields.

The provider selection is resolved in one place so doctor output matches runtime behavior: DEEPSEEK_SEARCH_PROVIDER takes 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 --check
  • cargo test -p codewhale-tui doctor_endpoint_tests::doctor_search_provider -- --nocapture
  • cargo test -p codewhale-tui config::tests::search_provider_resolution -- --nocapture
  • cargo check -p codewhale-tui
  • cargo run -q -p codewhale-tui -- doctor --json
  • DEEPSEEK_SEARCH_PROVIDER=tavily cargo run -q -p codewhale-tui -- doctor --json

Signed-off-by: Nanook <nanookclaw@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

doctor: show active search provider in codewhale doctor output

1 participant