Summary
This tracks the deferred Phases 3-4 from #3384 / PR #6814: wiring interceptFetch into the SSE chat pipeline and adding the dashboard toggle.
What exists already
Phase 1-2 (shipped in #6814, release/v3.8.47):
src/lib/db/interceptionRules.ts — DB CRUD for interception_rules (key_value namespace), with fields for both interceptSearch and interceptFetch
resolveInterceptSearch(provider, model) — fully implemented
prepareWebSearchFallbackBody() wired in chatCore.ts with the search override
The DB types already include: interceptFetch, fetchBackend, fetchProxyUrl at both provider and per-model level — so no schema changes are needed.
What's missing (Phases 3-4)
-
resolveInterceptFetch(provider, model) — analogous to resolveInterceptSearch, returning boolean | undefined with the same provider to model precedence.
-
Call site in the chat pipeline — when interceptFetch === true, route the provider-native web_fetch tool call through OmniRoute's /v1/web/fetch instead of letting it pass through to the provider. This mirrors how interceptSearch routes to /v1/search in webSearchFallback.ts.
-
Dashboard UI toggle — a per-model / per-provider toggle in the dashboard settings UI (the PR description explicitly deferred this).
Implementation guidance
- Follow the exact pattern of
resolveInterceptSearch / webSearchFallback.ts — the search and fetch paths are structurally parallel.
/v1/web/fetch already exists (src/app/api/v1/web/fetch/route.ts, backed by open-sse/handlers/webFetch.ts), so the interceptor just needs to route to it.
References
Summary
This tracks the deferred Phases 3-4 from #3384 / PR #6814: wiring
interceptFetchinto the SSE chat pipeline and adding the dashboard toggle.What exists already
Phase 1-2 (shipped in #6814, release/v3.8.47):
src/lib/db/interceptionRules.ts— DB CRUD forinterception_rules(key_value namespace), with fields for bothinterceptSearchandinterceptFetchresolveInterceptSearch(provider, model)— fully implementedprepareWebSearchFallbackBody()wired inchatCore.tswith the search overrideThe DB types already include:
interceptFetch,fetchBackend,fetchProxyUrlat both provider and per-model level — so no schema changes are needed.What's missing (Phases 3-4)
resolveInterceptFetch(provider, model)— analogous toresolveInterceptSearch, returningboolean | undefinedwith the same provider to model precedence.Call site in the chat pipeline — when
interceptFetch === true, route the provider-nativeweb_fetchtool call through OmniRoute's/v1/web/fetchinstead of letting it pass through to the provider. This mirrors howinterceptSearchroutes to/v1/searchinwebSearchFallback.ts.Dashboard UI toggle — a per-model / per-provider toggle in the dashboard settings UI (the PR description explicitly deferred this).
Implementation guidance
resolveInterceptSearch/webSearchFallback.ts— the search and fetch paths are structurally parallel./v1/web/fetchalready exists (src/app/api/v1/web/fetch/route.ts, backed byopen-sse/handlers/webFetch.ts), so the interceptor just needs to route to it.References
src/lib/db/interceptionRules.tsopen-sse/services/webSearchFallback.tssrc/app/api/v1/web/fetch/route.ts