Files
OmniRoute/src/lib/db/migrations/120_interception_rules.sql
Diego Rodrigues de Sa e Souza 9159b286d0 feat: per-model web-search interception rule (#3384) (#6814)
* feat(routing): per-model web-search interception rule (#3384)

Adds a per-provider/per-model interceptSearch rule (src/lib/db/interceptionRules.ts,
key_value namespace interception_rules) that overrides the existing native
web-search bypass defaults (Codex/Gemini/Claude->Claude passthrough) in
webSearchFallback.ts. Wired at the existing prepareWebSearchFallbackBody() call
site in chatCore.ts. Resolution precedence: per-model rule > provider-level rule
> existing native-bypass defaults.

This lands Phase 1-2 of the plan (rule store + search interception). Web-fetch
interception and the dashboard UI toggle are tracked as follow-up phases.

* fix(db): register interceptionRules in localDb re-export layer (db-rules gate)

* fix(db): renumber interception_rules migration 119→120 (collision with model_capability_overrides)
2026-07-11 05:03:56 -03:00

17 lines
697 B
SQL

-- 120_interception_rules.sql
-- Documents the interception_rules namespace in the key_value table (#3384).
-- No schema change — the key_value table already exists.
-- Key = provider ID, value = JSON with shape:
-- {
-- interceptSearch?: boolean,
-- interceptFetch?: boolean,
-- fetchBackend?: "firecrawl"|"jina"|"tavily",
-- fetchProxyUrl?: string,
-- models?: { [modelId]: { interceptSearch?, interceptFetch?, fetchBackend?, fetchProxyUrl? } }
-- }
--
-- Resolution precedence: per-model rule > provider-level rule > undefined (caller
-- falls back to the existing native web-search-bypass defaults in webSearchFallback.ts).
--
-- See: src/lib/db/interceptionRules.ts