fix: show only provider-relevant fields in Search settings#570
Merged
pancacake merged 2 commits intoJun 19, 2026
Merged
Conversation
20 tasks
vaskoyudha
added a commit
to vaskoyudha/deeptutor-for-programmer-fork
that referenced
this pull request
Jul 25, 2026
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.
Description
The Search settings editor (
/settings/search) rendered both the API Key and Base URL inputs for every web-search provider, regardless of whether the selected provider uses them. This is misleading:This PR renders the two connection fields conditionally, per provider, mirroring the backend resolver
resolve_search_runtime_configindeeptutor/services/config/provider_runtime.py:A small pure helper (
web/components/settings/search-providers.ts) holds the capability table so it can be unit-tested and kept in sync with the backend. LLM and embedding editors are unchanged. One new i18n string was added (en + zh).💬 Open to discussion
These visibility rules are a proposal, not dogma. If anything doesn't match your intent, let's discuss before merging — happy to adjust. A few choices I'd especially welcome feedback on:
base_urlfrom the API, so it's only ever set for SearXNG — but say the word if you'd rather keep it visible as an advanced override).serper(the backend still treats it as supported and key-requiring, so I kept it shown).Related Issues
No existing issue — searched open/closed issues and PRs; none cover this. Happy to open one if preferred.
Module(s) Affected
agentsapiconfigcoreknowledgeloggingservicestoolsutilsweb(Frontend)docs(Documentation)scriptstests...Checklist
pre-commit runon the changed files — all hooks pass.Screenshots
A couple of representative examples (not exhaustive — the full behavior is in the table above):
Key-based provider (e.g. Jina) — only the API Key field is shown; Base URL is hidden:
Zero-config provider (DuckDuckGo) — no API Key or Base URL fields at all; the form goes straight to the optional Extra section:
Additional Notes
Verification
tsc --noEmit(full project) — cleannode --test—tests/search-providers.test.ts(7 cases: key-only, searxng-required, zero-config, unknown→show-all, case-insensitive, plus two invariant guards) passes; full web suite greeneslint— 0 errors (no new warnings)i18n:parity— OK (new key present inen+zh)Scope (intentionally left out)
serper(frontend marks it deprecated in the warning text; backend treats it as supported and key-requiring). This PR shows the API Key field forserperper the backend (it needs one) and does not otherwise touch that mismatch.