diff --git a/open-sse/services/webFetchInterception.ts b/open-sse/services/webFetchInterception.ts index eb464110fe..32861395f6 100644 --- a/open-sse/services/webFetchInterception.ts +++ b/open-sse/services/webFetchInterception.ts @@ -16,6 +16,10 @@ export const OMNIROUTE_WEB_FETCH_FALLBACK_TOOL_NAME = "omniroute_web_fetch"; const WEB_FETCH_TOOL_TYPES = new Set(["web_fetch", "web_fetch_20250910"]); type JsonRecord = Record; +type WebFetchFallbackBody = JsonRecord & { + tools?: unknown; + tool_choice?: unknown; +}; export interface WebFetchFallbackPlan { enabled: boolean; @@ -88,7 +92,7 @@ export function supportsNativeWebFetchFallbackBypass({ }: { provider?: string | null; sourceFormat?: string | null; - targetFormat: string | null | undefined; + targetFormat?: string | null; nativeCodexPassthrough: boolean; // Per-model rule (#3384/#7339) — resolveInterceptFetch() in src/lib/db/interceptionRules.ts. // true = force interception; anything else (false/undefined, i.e. no operator @@ -104,7 +108,7 @@ export function supportsNativeWebFetchFallbackBypass({ return interceptFetchOverride !== true; } -export function prepareWebFetchFallbackBody( +export function prepareWebFetchFallbackBody( body: T, options: { provider?: string | null; diff --git a/open-sse/services/webSearchFallback.ts b/open-sse/services/webSearchFallback.ts index 9d80610d47..7ae1749803 100644 --- a/open-sse/services/webSearchFallback.ts +++ b/open-sse/services/webSearchFallback.ts @@ -9,6 +9,10 @@ const SEARCH_CONTEXT_DEFAULTS: Record = { }; type JsonRecord = Record; +type WebSearchFallbackBody = JsonRecord & { + tools?: unknown; + tool_choice?: unknown; +}; export interface WebSearchFallbackPlan { enabled: boolean; @@ -146,7 +150,7 @@ export function supportsNativeWebSearchFallbackBypass({ }: { provider?: string | null; sourceFormat?: string | null; - targetFormat: string | null | undefined; + targetFormat?: string | null; nativeCodexPassthrough: boolean; // Per-model rule (#3384) — resolveInterceptSearch() in src/lib/db/interceptionRules.ts. // true = force interception (never bypass); false = force native bypass; undefined = @@ -172,7 +176,7 @@ export function supportsNativeWebSearchFallbackBypass({ return false; } -export function prepareWebSearchFallbackBody( +export function prepareWebSearchFallbackBody( body: T, options: { provider?: string | null;