From af598fd6252804b08f6f33df7612ec5c621e50a8 Mon Sep 17 00:00:00 2001 From: Mike Tuev R9FT Date: Wed, 23 Sep 2026 22:33:19 +0500 Subject: [PATCH] fix(dashboard): let the web-search route model be cleared again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `settings.webSearchRouteModel` (layer 2 of #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 ` renders its placeholder as `disabled` + // (ModelSelectField -> Select `placeholderDisabled={!allowEmpty}`), so + // once a model was picked the override could never be cleared from the + // dashboard again — every web_search request stayed pinned to it + // (webSearchRouting.ts resolveWebSearchRouteOverride). `allowCustomInput` + // additionally exposes the free-text field so an unlisted/self-hosted + // target can be typed and blanked, matching the Modality Bridge pickers. + allowEmpty + allowCustomInput + testId="web-search-route-model" disabled={loading} ariaLabel={t("webSearchRouteTitle")} /> diff --git a/tests/unit/ui/web-search-route-model-clearable.test.tsx b/tests/unit/ui/web-search-route-model-clearable.test.tsx new file mode 100644 index 000000000000..cd478614b3cd --- /dev/null +++ b/tests/unit/ui/web-search-route-model-clearable.test.tsx @@ -0,0 +1,112 @@ +// @vitest-environment jsdom +/** + * The Web-Search Routing setting (`settings.webSearchRouteModel`, layer 2 of #4481) + * is documented as "leave blank to disable": when it holds a model, EVERY request + * carrying a native web_search tool is rerouted to that model + * (open-sse/services/webSearchRouting.ts -> resolveWebSearchRouteOverride). + * + * The dashboard field rendered a without `allowEmpty`, which makes + * the