Repository navigation
fix(dashboard): let the web-search route model be cleared again - #14674
diegosouzapw merged 1 commit into
Conversation
`settings.webSearchRouteModel` (layer 2 of diegosouzapw#4481) reroutes EVERY request carrying a native web_search tool to the configured model (`webSearchRouting.ts::resolveWebSearchRouteOverride`), and its own help text says "leave blank to disable". The dashboard field, however, rendered `ModelSelectField` without `allowEmpty`, so the underlying `<Select>` marked its placeholder `disabled` (`placeholderDisabled={!allowEmpty}`). Once any model had been selected, the blank value was unreachable from the UI — the override stayed pinned forever and every web_search request silently left the operator's configured provider (observed live: `WEBSEARCH-ROUTE web_search tool -> model override: claude-opus-5-5 -> cx/gpt-6-astra`). The only way out was editing the settings row in SQLite by hand. Pass `allowEmpty` so the blank option is selectable, plus `allowCustomInput` so an unlisted/self-hosted target can be typed and blanked — matching how the Modality Bridge pickers already use the same component. The API side already accepted the empty value: `settingsSchemas.ts` types it as `z.string().max(200).optional()` and the paid-model guard in `src/app/api/settings/route.ts` only runs for a non-empty string.
|
Docs Gates (fast-path) → step
API Route Typecheck → 4 new diagnostics, all in files this PR does not touch: Both belong in their originating branches, not here. |
|
Clean, well-scoped fix — traced |
d124bb7
into
diegosouzapw:release/v3.8.51
Problem
settings.webSearchRouteModel(layer 2 of #4481) reroutes every request carrying a nativeweb_searchtool to the configured model —open-sse/services/webSearchRouting.ts::resolveWebSearchRouteOverride. Its own help text says "Leave blank to disable".But the dashboard field renders
ModelSelectFieldwithoutallowEmpty:ModelSelectFieldforwardsplaceholderDisabled={!allowEmpty}to<Select>, so the blank option is rendereddisabled. Once any model is selected, the operator can never go back to blank from the UI — the override stays pinned forever.Observed live on a Claude Code + Anthropic-provider setup: web search silently stopped working because every search request was being rerouted away from the configured provider.
{"tag":"WEBSEARCH-ROUTE","msg":"web_search tool → model override: claude-opus-5-5 → cx/gpt-6-astra"}The only recovery was editing the settings row in SQLite by hand.
Fix
Pass
allowEmpty(blank option becomes selectable) andallowCustomInput(free-text field, so an unlisted/self-hosted target can be typed and blanked) — the same combination the Modality Bridge Vision/Audio pickers already use with this component.No API change needed:
settingsSchemas.tsalready types it asz.string().max(200).optional(), and thehidePaidModelsguard insrc/app/api/settings/route.tsonly runsif (typeof body.webSearchRouteModel === "string" && body.webSearchRouteModel.trim() !== "").Validation (TDD)
New
tests/unit/ui/web-search-route-model-clearable.test.tsx(vitest + jsdom, 3 cases):allowEmptythe picker renders a non-disabled blank option and selecting it emitsonChange("");allowEmptythe blank option isdisabled— pins the old behavior so the regression is unambiguous;RoutingTabmust keep passingallowEmptyto thewebSearchRouteModelpicker.expected false to be true).