Skip to content

fix(ui): show web search providers for all models#13472

Merged
kangfenmao merged 1 commit intomainfrom
fix/web-search-provider-state-leak
Mar 15, 2026
Merged

fix(ui): show web search providers for all models#13472
kangfenmao merged 1 commit intomainfrom
fix/web-search-provider-state-leak

Conversation

@EurFelux
Copy link
Copy Markdown
Collaborator

What this PR does

Before this PR:
Web search provider options (Tavily, SearXNG, etc.) were only shown for models matching isFunctionCallingModel() or when the user explicitly set prompt tool-use mode. Local LLM models (e.g. Ollama) showed an empty web search panel.

After this PR:
Web search provider options are always available for all models.

Fixes #13466

Why we need it and why it was done in this way

At runtime, models that lack native function-calling support automatically fall back to prompt-based tool use (ApiService.ts:254-256), so web search providers work regardless of model capability. The UI gate was unnecessarily restrictive and out of sync with runtime behavior.

The following tradeoffs were made:

  • This removes the UI-level capability check entirely. A discussion point is whether users should be informed that prompt-based tool use is being used as a fallback (no visual indicator currently exists).

The following alternatives were considered:

  • Matching the gate to the runtime fallback condition (isFunctionCallingModel || isToolUseModeFunction) — rejected because prompt mode has almost no model restrictions, making any gate unnecessary.

Breaking changes

None.

Special notes for your reviewer

Behavior change: selecting a web search provider on a non-function-calling model now silently triggers prompt-based tool use at runtime (this fallback already existed but was previously unreachable from the UI). Please consider whether this implicit fallback is acceptable or if it needs a user-visible indicator.

Checklist

  • PR: The PR description is expressive enough and will help future contributors
  • Code: Write code that humans can understand and Keep it simple
  • Refactor: You have left the code cleaner than you found it (Boy Scout Rule)
  • Upgrade: Impact of this change on upgrade flows was considered and addressed if required
  • Documentation: N/A
  • Self-review: I have reviewed my own code before requesting review from others

Release note

Fixed web search provider options not showing for local LLM models (e.g. Ollama) in the chat input toolbar.

Remove the `isFunctionCallingModel || isPromptToolUse` gate on the web
search provider list in WebSearchQuickPanelManager. At runtime, models
that lack native function-calling support automatically fall back to
prompt-based tool use, so web search providers work regardless of model
capability. The UI should reflect this by always showing provider options.

Fixes #13466

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: icarus <[email protected]>
@kangfenmao kangfenmao merged commit c6ce1de into main Mar 15, 2026
7 checks passed
@kangfenmao kangfenmao deleted the fix/web-search-provider-state-leak branch March 15, 2026 01:49
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.

[Bug]: Web Search UI

2 participants