Skip to content

Commit a03f51a

Browse files
committed
fix(web-search): unify WebSearchBackend with the five-value union after rebase
Cross-layer reconciliation: #2209 introduced the (backend, model) pair contract typed as openai|anthropic; #2238 widened the configured union to five backends. The options module now re-exports WebSearchBackendId and passes config into isActive, so inert arms simply never produce rows. tsc clean; 48/0 across the three web-search suites.
1 parent 3b0db07 commit a03f51a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎src/server/management/web-search-sidecar-options.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ import type { OcxConfig } from "../../types";
1717
import { AUTH_SLOT_MODELS, resolveSidecarAuth } from "../../sidecar/auth";
1818
import { pickerVisibleSidecarCandidates, type SidecarCandidate } from "../../sidecar/candidates";
1919
import { WEB_SEARCH_BACKENDS, webSearchSidecarCandidates } from "../../web-search/backends";
20+
import type { WebSearchBackendId } from "../../web-search/index";
2021

21-
export type WebSearchBackend = "openai" | "anthropic";
22+
// The full configured union. Rows only ever materialize for backends whose
23+
// executor admits the candidate, so inert arms (gemini/exa without config)
24+
// simply never produce rows.
25+
export type WebSearchBackend = WebSearchBackendId;
2226

2327
export interface WebSearchCandidateRow extends SidecarCandidate {
2428
/** Executor backend that admitted this exact candidate row. */
@@ -40,8 +44,8 @@ export async function webSearchCandidateRows(config: OcxConfig): Promise<WebSear
4044
const auth = resolveSidecarAuth(config);
4145
const all = await pickerVisibleSidecarCandidates(config, auth);
4246
return webSearchSidecarCandidates(config, auth, all).flatMap(candidate => {
43-
const descriptor = WEB_SEARCH_BACKENDS.find(entry =>
44-
entry.isActive(auth) && entry.eligibleModel(candidate, auth));
47+
const descriptor = WEB_SEARCH_BACKENDS.find(entry =>
48+
entry.isActive(auth, config) && entry.eligibleModel(candidate, auth));
4549
return descriptor ? [{ ...candidate, backend: descriptor.backend }] : [];
4650
});
4751
}

0 commit comments

Comments
 (0)