* chore(ci): add .mergify.yml to main — Mergify only reads config from the default branch (#7168) * fix(ci): add the auto-enqueue pull_request_rule to the Mergify config (queue_conditions alone are eligibility-only) (#7179) * fix(ci): migrate Mergify auto-enqueue to merge_protections_settings.auto_merge_conditions (rules-based path is EOL 2026-07-16) (#7216) * fix(ci): drop Mergify batch settings (batching is a paid-tier feature; free plan queue is serial) (#7220) * fix(ci): merge queue tolerates the advisory dast-smoke failure (its GH-hosted build hang dequeued every attempt) (#7225) * test(ci): make the #6634 selfref guard hermetic — main's copy hard-fails every PR (#7341) main's copy of this test still does git I/O inside a unit test: const baseSrc = git(['show', 'origin/main:' + FILE]); Runners check out a shallow single ref, so origin/main does not resolve and the test dies with 'fatal: invalid object name origin/main'. Every PR into main fails Unit Tests (7/8) on it — today that is #7313, #7315, #7316, #7334, #7336 and #7337, six PRs red on a defect none of them introduced. #7313 has no other red at all. release/v3.8.49 already carries a fix (2e42b8efc, #7174: try/catch, fetch origin/main on demand, t.skip() when unreachable), but it only reaches main at release time — so main stays broken for the whole cycle. Cherry-picking it would also import a new problem: PR Test Policy classifies t.skip() as a silenced assertion, which we watched it correctly catch on #7300 today. This is the hermetic version instead (ported from #7327, which does the same for the release branch): read the file straight off disk, compare against an empty base so baseTaut/baseExtTaut are 0 — the strictest possible comparison point — and call evaluateMasking() directly. No git ref, no fetch, no skip, nothing the runner's checkout depth can break. The #6634 regression stays covered: the guard's logic lives in SELF_TEST_FIXTURE_RE (check-test-masking.mjs:337), not in the test. Proven both ways on main before committing — neutralise SELF_TEST_FIXTURE_RE to /$^/ and the test FAILS; restore it and it passes 2/2, with check-test-masking.mjs left byte-identical. Co-authored-by: growab <nekron@icloud.com> * chore(quality): tighten main's coverage baseline to the CI's real numbers (#7347) main's ratchet had been failing --require-tighten on every PR: 11 metrics improved but the baseline was never tightened. Same class as the #6634 selfref guard — an infra fix that lands only on the release branch leaves main red for the whole cycle, and every PR into main pays for it. Values are the merged-coverage numbers from a run on main itself (a local run measures ~68% vs CI's ~80%; the baseline's own note warns about that gap). Only the 11 coverage values change — gitleaks and semgrepFindings keep main's own state. No changelog fragment: #7326 carries it on release/v3.8.49, and a second one here would double the entry at release time. * Add cliproxy provider exposure controls and manifest injection (#7329) * feat(fusion): let judge use its own knowledge and override the panel (#6804) The judge prompt said to write an answer 'grounded in that analysis', implicitly capping output at the panel's union. When all panel members miss or are collectively wrong on something, the judge should apply its own reasoning as a full participant and override consensus, while keeping an honesty guard against fabrication. Adds a regression test. Co-authored-by: Chirag Singhal <chirag127@users.noreply.github.com> * fix(api): raise provider apiKey cap for cookie-based web providers (#6715) (#6759) * fix(cli): fall back to settings.json when Claude Code binary is unresolvable (#6701) (#6734) getCliRuntimeStatus() only ever answered `installed` from binary resolution (known install paths + where/which PATH search), so a stale PATH, moved binary, or uncatalogued install method reported "not found" even when ~/.claude/settings.json proved the CLI was installed and used before — regressing behind upstream 9router's checkClaudeInstalled(), which already falls back to the settings file when where/which fails. withSettingsFallback() (new src/shared/services/cliInstallFallback.ts, kept out of the frozen cliRuntime.ts to respect its file-size ceiling) restores that parity: only when the binary lookup's own reason is "not_found" (never for deliberate security rejections like unsafe/relative env overrides or symlink escapes) and the tool's settings file exists on disk. * fix(providers): honor explicit thinking.budget_tokens 0 in openai->gemini transform (#6813) (#6821) The transform forwarded the Claude-style thinking.budget_tokens into generationConfig.thinkingConfig.thinkingBudget, but the presence check was truthy (&& thinking.budget_tokens). An explicit budget_tokens: 0 — the natural way to disable thinking — is falsy, so it was dropped and the request fell through to the default thinkingConfig injection, making the model think despite an explicit request for zero. Use an explicit numeric check so 0 is honored as thinkingBudget 0; includeThoughts is only set for a non-zero budget. * fix(compression): reconcile outer vs per-engine token counts (#6488) (#6741) * fix(compression): reconcile outer vs per-engine token counts on degenerate output (#6488) Outer originalTokens/compressedTokens (real tiktoken counter over extracted message text) diverged from engineBreakdown[0]'s counts (a crude JSON.stringify(requestBody).length/4 estimate), worst on small/degenerate inputs where JSON structural overhead dominates. A single-engine breakdown entry represents the exact same before/after transformation as the overall response, so reconcileSingleEngineTokens() now overwrites that one entry's counts with the outer, more accurate figures; multi-step pipeline breakdowns are left untouched. * chore(6741): resolve release sync — CHANGELOG.md restored to release tip, entry moved to changelog.d fragment (fragments-first) * fix(api): accept enableRenderers in RTK compression config schema (#6703) (#6757) * fix(db): break probe-failed/restore loop on large storage.sqlite (#6632) Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR); keeps only the author's changes. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * feat(cursor): add Opus 4.8, Fable 5, and Sonnet 5 model families (#6779) Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR); keeps only the author's cursor registry + test changes. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(translator): read PDF/video file attachments for Gemini/Antigravity and Claude (#6790) Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR); keeps only the author's translator + test changes. Co-authored-by: Wital <witalorocha216@gmail.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(codex): strip include from compact responses requests (#6805) * fix(codex): strip include from compact responses requests Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR); keeps only the author's changes. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(6805): move include-strip assertion to standalone test file to keep executor-codex.test.ts under frozen size cap Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(i18n): translate hardcoded Portuguese dashboard strings to English (#6769) Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR); keeps only the author's changes. Co-authored-by: Chirag Singhal <chirag127@users.noreply.github.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(bootstrap): filter empty process.env values to prevent Docker env crash loop (#6828) Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR) and the direct CHANGELOG.md edit (fragments-first); keeps only the author's bootstrap change. Co-authored-by: Andrian B. <andrewbalanesq@gmail.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(providers): update SenseNova Token Plan support (#6330) Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR); the author's constants/registry/snapshot deltas were re-applied cleanly onto the release tip. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(providers): classify 404 as MODEL_NOT_FOUND to stop retry storm (#6829) Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR) and the direct CHANGELOG.md edit (fragments-first); the author's chatCore/errorClassifier deltas were re-applied cleanly onto the release tip. Co-authored-by: Andrian B. <andrewbalanesq@gmail.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(api): accept all catalog engines on compression PUT schema (#6792) Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR). Resolved the release's OmniGlyph engine addition additively (types.ts/compression.ts kept both 'relevance' and 'omniglyph') and extended stackedPipelineStepSchema + STACKED_PIPELINE_ENGINE_INTENSITIES with the omniglyph branch so the ENGINE_CATALOG-parity test passes. Co-authored-by: Pitchfork-and-Torch <Pitchfork-and-Torch@users.noreply.github.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(api): point CLI health command at /api/monitoring/health (#6677) (#6717) * fix(api): point CLI health command at /api/monitoring/health (#6677) bin/cli/commands/health.mjs called GET /api/health, a route that was moved to /api/monitoring/health without updating the CLI; the top-level /api/health handler never existed on disk (only degradation/ and ping/ sub-routes). Point runHealthCommand()/runHealthComponentsCommand() at /api/monitoring/health and read its real payload shape (activeConnections, circuitBreakers: {open,halfOpen,closed}, memoryUsage) instead of the old nonexistent requests/breakers/cache/memory fields. * chore(6717): re-sync onto release tip; move CHANGELOG entry to changelog.d fragment (fragments-first) * chore(cursor): add Grok 4.5 effort/fast model IDs (#6774) Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR); keeps only the author's changes. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(providers): ensure DeepSeek Web SSE emits [DONE] after FINISHED (#6791) * fix(providers): ensure DeepSeek Web SSE emits [DONE] after FINISHED Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR); keeps only the author's changes. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * refactor(deepseek): extract done-terminator helper to keep frozen file under cap Extracts the FINISHED-drain scheduler and finish-once guard added for the [DONE] terminator fix (#6777) into a new deepseek-web-done-terminator.ts module, so deepseek-web.ts stays under its frozen line cap (1148). Behavior is unchanged. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: Pitchfork-and-Torch <Pitchfork-and-Torch@users.noreply.github.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * feat(models): add capability override UI (#6727) * feat(models): add capability override UI Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR); renumbered the migration 118 -> 119 to resolve the collision with 118_provider_param_filters.sql already on release/v3.8.47; the author's i18n/localDb deltas were re-applied cleanly onto the release tip. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(6727): import model-capability-overrides DB fns directly (not via localDb barrel) to keep localDb under file-size cap; aligns with anti-barrel convention * chore(db): satisfy known-symbols contract for modelCapabilityOverrides Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com> * fix(cursor): use Agent CLI build id for x-cursor-client-version (#6795) * fix(cursor): use Agent CLI build id for x-cursor-client-version Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR); the author's .env.example/docs deltas were re-applied cleanly onto the release tip. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * chore(changelog): re-sync CHANGELOG.md to release tip (restore #6701 bullet) Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(startup): rename reasoningControls.ts to avoid webpack casing collision (#6584) (#6718) * fix(startup): rename reasoningControls.ts to avoid webpack casing collision (#6584) * chore(6718): re-sync onto release tip; CHANGELOG entry → changelog.d fragment (fragments-first) * fix(build): suppress Turbopack over-bundling warning from agentSkills generator (#6582) (#6720) * fix(build): suppress Turbopack over-bundling warning from agentSkills generator (#6582) generator.ts builds outputBase from a non-literal outputDir parameter, so Turbopack's file-tracing analyzer can't narrow it and emits an "Overly broad patterns" warning per entry point that imports the module (603 warnings on v3.8.46, up from 379). The fs access is legitimate and bounded, so next.config.mjs now suppresses this specific diagnostic via turbopack.ignoreIssue, mirroring the existing webpack.ignoreWarnings precedent in the same file. * chore(6720): re-sync onto release tip; CHANGELOG entry → changelog.d fragment (fragments-first) * fix(providers): drop image_generation for Codex Spark models regardless of plan (#6651) (#6721) * fix(providers): drop image_generation for Codex Spark models regardless of plan (#6651) * chore(6721): re-sync onto release tip; CHANGELOG entry → changelog.d fragment (fragments-first) * fix(providers): stop quota card re-sorting Codex/GLM bars by remaining % (#6687) (#6722) * fix(providers): stop quota card re-sorting Codex/GLM bars by remaining % (#6687) QuotaCardExpanded.tsx unconditionally re-sorted quotas by remaining percentage via sortQuotasByRemaining(), discarding the deterministic CODEX_QUOTA_ORDER/GLM_QUOTA_ORDER window order quotaParsing.ts's sortCodexOrder()/sortGlmOrder() had already established. A new hasFixedQuotaOrder() + resolveQuotaDisplayOrder() skip the re-sort for providers with a fixed window order (codex, glm family), threading providerId from QuotaCard.tsx through to the display layer. Regression guard: tests/unit/quota-card-expanded-fixed-order-6687.test.ts * chore(6722): re-sync onto release tip; CHANGELOG entry → changelog.d fragment (fragments-first) * fix(startup): lazy-import ioredis in rateLimiter to fix MCP ERR_MODULE_NOT_FOUND (#6559) (#6725) * fix(startup): lazy-import ioredis in rateLimiter to fix MCP ERR_MODULE_NOT_FOUND (#6559) * chore(6725): re-sync onto release tip; CHANGELOG entry → changelog.d fragment (fragments-first) * fix(resilience): resolve fp-pinned combo account back to real connection id (#6696) (#6732) * fix(resilience): resolve fp-pinned combo account back to real connection id (#6696) * chore(6732): re-sync onto release tip; CHANGELOG entry → changelog.d fragment (fragments-first) * fix(api): Responses passthrough emits event-only SSE frames after filtering commentary output (#6561) (#6735) * fix(api): Responses passthrough emits event-only SSE frames after filtering commentary output (#6561) The #6199 commentary-drop `continue;` branches in stream.ts skipped the data: line for a dropped commentary event but never cleared the already-buffered event: line for the same frame, so the next blank line flushed the stale event: line alone -- an event-only SSE frame that crashes the OpenAI Python SDK's json.loads(). Both drop sites now call clearPendingPassthroughEvent() before continue. The commentary-drop decision was extracted into a new responsesCommentaryDrop.ts module so the fix does not grow the frozen stream.ts. * chore(6735): re-sync onto release tip; CHANGELOG entry → changelog.d fragment (fragments-first) * fix(api): emit reasoning_content on claude-web + v0-vercel-web SSE (#6662) (#6743) * fix(api): emit reasoning_content on claude-web + v0-vercel-web /v1/chat/completions SSE (#6662) * chore(6743): re-sync onto release tip; CHANGELOG entry → changelog.d fragment (fragments-first) * fix(sse): unwrap bare {function:{…}} tools in openai→claude translation (#6704) * fix(sse): unwrap bare {function:{…}} tools in openai→claude translation Some OpenAI-shape clients send a tool as a bare `{ function: {...} }` object, omitting the spec-required `type: "function"` parent wrapper. The tools-mapping in openai-to-claude.ts (~line 366) only unwrapped `tool.function` when `tool.type === "function"` was ALSO true, so a bare-function tool fell through to `toolData = tool` (the wrapper itself, with no `.name`), producing an empty `originalName` and silently dropping the tool from the translated request — worse than a 400, since the caller has no signal the tool never made it upstream. Unwrap `tool.function` whenever present, independent of the parent `type` field. Regression guard: tests/unit/openai-to-claude-bare-tool.test.ts. Co-authored-by: Samir Abis <me@samirabis.com> Inspired-by: https://github.com/decolua/9router/pull/2473 * chore(6704): re-sync onto release tip; CHANGELOG → changelog.d fragment (fragments-first) --------- Co-authored-by: Samir Abis <me@samirabis.com> * fix(oauth): avoid bare-email dedup of Codex OAuth logins (#6706) * fix(oauth): avoid bare-email dedup of Codex OAuth logins When an incoming Codex OAuth connection has no verifiable workspace/account id, do not merge it into an existing row on email match alone — that silently overwrote the other account's token pair. Require a matching chatgptUserId (a stable per-account JWT id) before merging; otherwise insert a distinct connection row. Co-authored-by: lucasjustinudin <34107354+lucasjustinudin@users.noreply.github.com> Inspired-by: https://github.com/decolua/9router/pull/2477 * chore(6706): re-sync onto release tip; CHANGELOG → changelog.d fragment (fragments-first) --------- Co-authored-by: lucasjustinudin <34107354+lucasjustinudin@users.noreply.github.com> * fix(sse): skip thinkingConfig for gemma models in openai→gemini translation (#6708) open-sse/translator/request/claude-to-gemini.ts already guards against sending thinkingConfig for gemma-4-* models (Gemma doesn't support it — Vertex returns 400: "Thinking budget is not supported for this model"), but the OpenAI-shape path (openai-to-gemini.ts) lacked the same guard, so OpenAI-shape clients hitting a vertex gemma-4-* model still got a 400. Mirrors the existing claude-to-gemini.ts guard: wrap the reasoning_effort and Claude-shape thinking.budget_tokens branches with a model.startsWith ("gemma-4") check. Branch 3 (default includeThoughts for modern Gemini models) already excludes non-"gemini" model ids and needed no change. Inspired-by: https://github.com/decolua/9router/pull/2480 Co-authored-by: chy1211 <31048289+chy1211@users.noreply.github.com> * fix(codex): surface capacity errors embedded in 200-OK SSE streams (#6710) * fix(codex): surface capacity errors embedded in 200-OK SSE streams Codex sometimes answers with HTTP 200 and a text/event-stream body whose payload carries a transient error mid-stream (e.g. "Selected model is at capacity...", server_is_overloaded, service_unavailable_error). Because the outer HTTP status was 200, this looked like a successful response to every caller — no retry, no circuit breaker, and no combo/account fallback ever engaged, so a healthy account sat idle while the request silently failed or truncated. Add peekCodexSseTransientError() to open-sse/executors/codex.ts: it peeks the first bytes of a text/event-stream Codex response, pattern-matches the known transient-error signatures, and converts a match into a real 503 Response via errorResponse() (Hard Rule #12 — sanitized, never raw upstream text). A 503 is already a recognized provider-failure status in accountFallback.ts, so combo routing and connection cooldown pick it up automatically. When no error signature is found, the peeked prefix is prepended back onto the remaining upstream body so the passthrough stays byte-identical to the unmodified response. Regression guard: tests/unit/codex-sse-capacity-fallback.test.ts — a model-at-capacity payload and a server_is_overloaded/service_unavailable_error payload both convert to 503; a normal single-chunk SSE stream and one split across multiple network chunks both reassemble byte-for-byte unchanged. Inspired-by: https://github.com/decolua/9router/pull/2452 (sub-bug #3 only — OmniRoute already covers PR #2452's other two sub-bugs: service_tier "fast" normalization and reasoning_effort "max" normalization). Co-authored-by: ryanngit <74137224+ryanngit@users.noreply.github.com> * chore(6710): re-sync onto release tip; CHANGELOG → changelog.d fragment (fragments-first) --------- Co-authored-by: ryanngit <74137224+ryanngit@users.noreply.github.com> * fix(volcengine): clamp Kimi max_tokens to Ark endpoint cap (#6712) * fix(volcengine): clamp Kimi max_tokens to Ark endpoint cap VolcEngine Ark's Kimi coding-plan endpoint (ark.cn-beijing.volces.com) enforces max_tokens <= 32768 server-side and returns 400 "integer above maximum value, expected a value <= 32768" for anything over that ceiling. OmniRoute's StripRule only supported dropping params outright, with no numeric clamp mechanism, so a client sending a larger max_tokens (common default, e.g. 65536) 400s outright against volcengine's kimi-k2-5-260127. The 32768 cap is independently confirmed against two live-endpoint bug reports hitting this exact Ark endpoint for both kimi-k2.5 and kimi-k2.7-code (NousResearch/hermes-agent#51773, MoonshotAI/kimi-cli#1124), not just upstream's own value — same cap upstream 9router#2460 uses. StripRule gains two optional fields: `clampToModelMaxOutput` (clamp to the model's own catalog maxOutputTokens ceiling, when set) and `maxOutputCap` (a fixed endpoint-imposed ceiling); when both apply, the lower wins. The new rule is scoped to the literal id `kimi-k2-5-260127` (OmniRoute's real volcengine Kimi model, not upstream's `Kimi-K2.7-Code`), not a broad /kimi/i regex, so it can never clamp an unrelated future Kimi listing whose Ark cap may differ. glm-4-7-251222 (the other volcengine model) is unaffected. Inspired-by: https://github.com/decolua/9router/pull/2460 Co-authored-by: whale9820 <whale9820@users.noreply.github.com> * chore(6712): re-sync onto release tip; CHANGELOG → changelog.d fragment (fragments-first) --------- Co-authored-by: whale9820 <whale9820@users.noreply.github.com> * fix(antigravity): surface aborted Gemini tool calls off end_turn (#6713) * fix(antigravity): surface aborted Gemini tool calls off end_turn Gemini/Antigravity aborts a turn with finishReason MALFORMED_FUNCTION_CALL (or a sibling like UNEXPECTED_TOOL_CALL) instead of completing cleanly. Both Claude-facing translators collapsed these to a clean end_turn, hiding the aborted tool call as a successful completion: - the OpenAI hub path (openai-to-claude.ts convertFinishReason default), and - the DIRECT Gemini->Claude path (gemini-to-claude.ts), which is the one Claude Code actually hits through an antigravity/Gemini-routed model. Add isAbortFinishReason() to finishReason.ts and map these reasons to tool_use on both paths; genuinely unknown reasons still fall back to end_turn. Co-authored-by: anhdiepmmk <n08ni.dieppn@gmail.com> Inspired-by: https://github.com/decolua/9router/pull/2462 * chore(6713): re-sync onto release tip; CHANGELOG → changelog.d fragment (fragments-first) --------- Co-authored-by: anhdiepmmk <n08ni.dieppn@gmail.com> * fix(translator): strip empty cloud_base_branch from Cursor Subagent tool call (#6729) * fix(translator): strip empty cloud_base_branch from Cursor Subagent tool call (port from 9router#2446) The Responses->Chat tool-arg cleanup (stripEmptyOptionalToolArgs) only stripped empty-string/empty-array optional args for Claude Code's Read tool. Cursor's local Subagent tool call therefore passed through with the cloud-only field cloud_base_branch: "", which Cursor rejects ("cloud_base_branch may only be specified when environment equals cloud") before starting the subagent. Extend the cleanup to an allowlist of Read + Subagent; arbitrary tools stay untouched. Reported-by: like3213934360-lab (https://github.com/decolua/9router/issues/2446) * chore(6729): re-sync onto release tip; CHANGELOG → changelog.d fragment (fragments-first) * fix(translator): defer content_block_start until GLM streams the tool name (#6730) * fix(translator): defer content_block_start until GLM streams the tool name (port from 9router#2077) GLM 5.2 (and similar OpenAI-compatible upstreams) stream a tool call's id and function.name across separate SSE delta chunks. The openai-to-claude streaming translator emitted content_block_start immediately on the id-only chunk with an empty name; the Claude SSE protocol cannot patch a block after emission, so the later name-only chunk was dropped and Claude Code rejected the tool_use with an empty tool name / "No such tool available:". Defer content_block_start until the name arrives (start on args if they arrive first), and emit a start for any orphaned id-only tool call at finish so content_block_stop is never orphaned. Reported-by: itiwant (https://github.com/decolua/9router/issues/2077) * chore(6730): re-sync onto release tip; CHANGELOG → changelog.d fragment (fragments-first) * feat(dashboard): add search to Playground model picker dropdown (#4086) (#6811) * feat(dashboard): add search to Playground model picker dropdown (#4086) The shared ModelSelectModal (combo builder + CLI-code cards) already had search, but the Playground's raw model <select> in StudioConfigPane stayed a flat unsearchable list - unusable once a provider like OpenRouter contributed 50+ models. Adds a search input above the dropdown that filters options via filterModelsByQuery() (Turkish-safe accent/case-insensitive match, reusing matchesSearch()). The currently selected model always stays pinned in the list even when it doesn't match the query, so typing never silently swaps the active selection. Reuses the existing common.search i18n key already translated in all 42 locales - no new key needed. * chore(6811): re-sync onto release tip; CHANGELOG → changelog.d fragment (fragments-first) * feat: request count log per provider, per date (#4009) (#6812) * feat(dashboard): request count log per provider, per date (#4009) Some providers bill by request rather than by token, so operators need a plain per-provider, per-date request count breakdown, not just token aggregates. Adds a new getProviderDailyUsageRows() aggregation query (src/lib/db/usageAnalytics.ts), a dedicated GET /api/usage/requests-by-provider-date route (kept separate from the frozen /api/usage/analytics route to respect the file-size baseline), and a sortable, single-date-filterable table on Dashboard -> Analytics. Closes #4009 * chore(6812): re-sync onto release tip; CHANGELOG → changelog.d fragment (fragments-first) * feat(xai): route xAI clients to Grok native /v1/responses endpoint (#6709) * feat(xai): route xAI clients to Grok native /v1/responses endpoint xAI ships a native /v1/responses endpoint (https://api.x.ai/v1/responses) alongside /v1/chat/completions, but XaiExecutor extended BaseExecutor without overriding buildUrl(), so every request always resolved to the static chat-completions baseUrl regardless of target format — the last genuinely-missing slice of decolua/9router#2439 (grok-build-0.1, the reasoning-effort suffix routing, and bare grok-* routing were already ported in prior cycles). Add responsesBaseUrl to the xai registry entry and tag grok-4.20-multi-agent-0309 (upstream's own Responses-only id) with targetFormat: "openai-responses", mirroring the existing model-tag-driven routing pattern already used by the gh executor (9router#102) and the "openai" -pro heuristic in open-sse/executors/default.ts — the per-model registry tag is the single source of truth that also drives chatCore's body translation, so URL and body stay in lockstep. XaiExecutor.buildUrl now checks getModelTargetFormat("xai", model) and resolves to the native Responses endpoint only for tagged models, leaving every other grok-* model on the existing chat-completions bridge. TDD: tests/unit/executor-xai.test.ts adds a RED-then-GREEN case asserting grok-4.20-multi-agent-0309 resolves to https://api.x.ai/v1/responses and a control case asserting grok-4.3 still resolves to https://api.x.ai/v1/chat/completions. Co-authored-by: ryanngit <74137224+ryanngit@users.noreply.github.com> Inspired-by: https://github.com/decolua/9router/pull/2439 * chore(6709): re-sync onto release tip; CHANGELOG → changelog.d fragment (fragments-first) --------- Co-authored-by: ryanngit <74137224+ryanngit@users.noreply.github.com> * fix(resilience): route remaining credential-selection call sites through quota preflight (#6686) (#6742) * fix(resilience): route remaining credential-selection call sites through quota preflight (#6686) * chore(6742): re-sync onto release tip; CHANGELOG entry → changelog.d fragment (fragments-first) * fix(resilience): apikey-provider 429s honor explicit quota-exhausted text (#6638) (#6731) * fix(resilience): apikey-provider 429s honor explicit quota-exhausted text (#6638) Ollama Cloud (and any other apikey-category provider) 429s skipped body-text quota classification entirely; a genuine multi-day quota exhaustion was misclassified as a plain rate_limit_exceeded with a few seconds of cooldown, so combo routing retried the account immediately. shouldPreserveQuotaSignals() now lets an explicit quota-exhausted signal (looksLikeQuotaExhausted) override the apikey-category default, and parseDayGranularityResetMs() adds day- granularity reset-hint parsing ("...reset in 3 days.") alongside the existing Xh/Ym/Zs parsing. Regression guard: tests/unit/issue-6638-ollama-quota.test.ts (RED before the fix, GREEN after). Aligned two tests/unit/account-fallback-service.test.ts cases that had codified the old buggy behavior for apikey-provider quota text. * chore(6731): re-sync onto release tip; CHANGELOG entry → changelog.d fragment (fragments-first) * feat(resilience): weekly-429 cooldown for fetcher-less providers (#3709) (#6817) * feat(resilience): weekly-429 cooldown for fetcher-less providers (#3709) Ollama Cloud free-tier accounts have a hard WEEKLY request cap. On cap the upstream returns 429 "you (<account>) have reached your weekly usage limit", but ollama-cloud is an apikey-category provider, so the existing oauth-only shouldUseQuotaSignal gate in checkFallbackError skips the subscription-quota-text classifier (Issue #2321) for its 429s -- the account fell through to the generic exponential backoff (~1s, capped at 2min) and got retried every few minutes for the rest of the week (one account took 285x429 in 48h). Adds a new, ungated weekly-usage-limit text classifier that applies a 24h QUOTA_EXHAUSTED cooldown regardless of provider category. Extracted the new classifier -- together with the existing #2321 subscription-quota logic -- into a new open-sse/services/quotaTextCooldowns.ts module so the frozen accountFallback.ts (file-size-baseline cap) didn't have to grow; net effect shrinks accountFallback.ts by 20 lines. This is Phase A of the plan (open-sse/services/accountFallback.ts:1038-1045 "weekly-429 cooldown"); Phase B (generic local request-counter preflight for manual provider_plans dimensions) is a separate, larger follow-up per the plan's own phasing. * chore(6817): re-sync onto release tip; CHANGELOG entry → changelog.d fragment (fragments-first) * fix(providers): Kiro adaptive-thinking allowlist excludes sonnet-4.5/haiku-4.5 (#6576) (#6726) * fix(providers): Kiro adaptive-thinking allowlist excludes sonnet-4.5/haiku-4.5 (#6576) * chore(6726): re-sync onto release tip; CHANGELOG entry → changelog.d fragment (fragments-first) * test(kiro): migrate selector-strip test to claude-sonnet-5 (only Kiro adaptive-thinking model, #6576) Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * chore(quality): rebaseline complexity 2053->2054 (merge-burst drift, v3.8.47) Inherited drift from today's /implement-prs merge burst (~36 PRs). check:complexity does not run on the PR->release fast-path, so the branch accrued +1 unmeasured. No orphan/feature PR introduces a NEW violation (complexity-net-zero); the only flagged function is the pre-existing getResolvedModelCapabilities. Owner-approved rebaseline to unblock the FQG of ~7 green-except-complexity orphans. * chore(stryker): register ollama-quota covering tests (merge-burst drift, v3.8.47) The 3 covering unit tests from #6731/#6817/#6742 (issue-6638-ollama-quota, ollama-cloud-weekly-quota-cooldown-3709, issue-6686-quota-preflight-coverage) exist on release but were never added to tap.testFiles when those PRs merged. Completes the registration so mutant kills count; unblocks every PR touching a mutated module. Part of the owner-approved merge-burst drift cleanup. * fix: auto-start WS server in-process and change default port to 20132 (#6072) * feat: change default LIVE_WS_PORT from 20129 to 20132 Update the default WebSocket port for the live dashboard server from 20129 to 20132 across all configuration files, documentation, code comments, and tests. Also consolidate OMNIROUTE_DISABLE_LIVE_WS and OMNIROUTE_ENABLE_LIVE_WS into a single OMNIROUTE_ENABLE_LIVE_WS flag. Wire the live WebSocket server to start in-process via instrumentation-node.ts. * feat: clarify NEXT_PUBLIC_LIVE_WS_PUBLIC_URL path usage and derive upgrade path from URL Update .env.example and ENVIRONMENT.md to document that the pathname portion of NEXT_PUBLIC_LIVE_WS_PUBLIC_URL (e.g. /live-ws) is used as the WebSocket upgrade path by the dev proxy, handshake response, and client connection logic. Extract deriveLiveWsPath() into shared/utils/wsPath.ts and wire it through: - src/app/api/v1/ws/route.ts — handshake response path field - src/hooks/useLiveDashboard.ts — build * fix: use the standard URL API to safely parse and update the effectiveWsUrl * build(docker): expose live WebSocket server port and configure CORS origins Add LIVE_WS_PORT (20132), LIVE_WS_HOST (0.0.0.0), and LIVE_WS_ALLOWED_ORIGINS environment variables to all Docker Compose profiles and expose the WebSocket port mapping. Prevent infinite self-loop in standalone-server-ws.mjs by skipping proxy when the server itself is running on the LiveWS port. * docs(env): fix comment formatting for HOST and HOSTNAME variables --------- Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(logs): prevent stale detail refresh reopening modal (#6323) * fix(logs): prevent stale detail refresh reopening modal * chore(stryker): register ollama-quota covering tests (release drift from merge burst) Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * \ feat: operator-configurable account rotation\ (#6763) * feat(resilience): operator-configurable account rotation Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR); the author's accountFallback/.env deltas were re-applied cleanly onto the release tip. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * docs(env): document configurable account-rotation env vars in ENVIRONMENT.md Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * refactor(rotation): extract rotation gate/context helpers to keep accountFallback.ts under frozen cap Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * chore(changelog): re-sync CHANGELOG.md to release tip (restore lost base bullet) Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * test(stryker): register rotation-config test in tap.testFiles for mutation coverage Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * test(stryker): register ollama-quota covering tests (drift from #6731/#6817/#6742) + re-sync Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com> * fix(lmarena): modernize Arena web provider + static Direct-chat catalog (#6280) * fix(lmarena): modernize Arena web provider + static Direct-chat catalog Update the lmarena provider for arena.ai (product rebranded from LMArena): - Route chat via arena.ai create-evaluation with Chrome TLS impersonation (tls-client-node) and optional browser-minted recaptchaV3Token. - Seed Text+Search (48) into the chat registry; seed Image (27) only into IMAGE_PROVIDERS. Disable live HTML model discovery; resolve public names to Arena UUIDs from the static TypeScript allowlist (no scrape JSON in-repo). - Soft-exclude 404/502 model ids; slow/stop bulk test-all probes for this provider. - Do not fold IMAGE_PROVIDERS/video specialty into the chat provider catalog when a chat registry already exists (lmarena/openai/xai). - Display name Arena (Free); keep wire id `lmarena` / alias `lma` for back-compat. - Theme-aware provider icons: arena-light.svg / arena-dark.svg. - Preserve split Supabase SSR cookie reconstruction for arena-auth-prod-v1.*. * fix(providers): align provider-models-route test fixture + regen provider reference Fold the topaz image-only catalog entry's apiFormat/supportedEndpoints into the local-catalog test fixture (route now tags media-only providers per the lmarena PR's staticModels.ts change), regenerate PROVIDER_REFERENCE.md against the merged release providers.ts, and add the changelog fragment for #6280. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * test: align web-cookie fallback suite — lmarena now has a registry entry (probe path) Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * docs(changelog): reconcile 3-day merge burst — 16 fragments, 4 promised credits, contributors hall 32→63 - changelog.d fragments for the 20 merged PRs that landed without a bullet (#6072 #6308 #6323 #6538 #6556 #6586 #6611 #6647 #6675 #6698 #6757 #6759 #6804 #6821 + ci rollup #6781/#6691/#6693 + docs rollup #6643/#6644/#6646/#6663; omniglyph bump #6661 folded into the #6556 bullet) - deliver the 4 credits promised in close comments but never written: @alltomatos (#6819 dup of #6721), @samimozcan (#6762/#6753 subsumed by #6790), @chirag127 (#6756 dup of #6757), @Squawk7777 (#6565 dup of #6564 — appended to the existing #6564 bullet; changelog-integrity flags that edit as a removal, intentional: ALLOW_CHANGELOG_REMOVALS justification) - rebuild the v3.8.47 Contributors hall from merged-PR authors + thanks credits + prior hall: 32 → 63 contributors * Clamp reasoning token buffer to model output cap (#6714) * fix(combo): clamp reasoning buffer to model output cap * fix(routing): preserve near-cap reasoning max tokens * fix(routing): getExplicitModelOutputCap falls through to registry cap on non-numeric synced limit_output getExplicitModelOutputCap short-circuited to null whenever a synced capability row existed, even if that row's limit_output was not a number (models.dev commonly omits it). That silently disabled the reasoning-token buffer clamp for any model with a synced row lacking an output limit. Now only return the synced value when it IS a number; otherwise fall through to registryModel.maxOutputTokens / spec.maxOutputTokens, matching the ??-chain precedence already used by getResolvedModelCapabilities(). Adds a standalone regression test (proves the fallthrough returns the real registry cap, not null) and hardens the #6274 fixture id so its no-output-cap case does not prefix-match the real glm-5.2 static spec. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * chore(stryker): register ollama-quota covering tests (release drift from merge burst) Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * feat(i18n): add Traditional Chinese (zh-TW) localization for frontend and CLI (#6320) * feat(i18n): add Traditional Chinese (zh-TW) localization for frontend and CLI - Add src/i18n/messages/zh-TW.json translating frontend web UI - Add bin/cli/locales/zh-TW.json translating CLI commands and descriptors - Register zh-TW in config/i18n.json and docs/guides/I18N.md - Update scripts/i18n/generate-multilang.mjs matching the new locale setup * fix: update i18n locale count from 42 to 43 after adding zh-TW The docs strict checker (check-docs-counts-sync.mjs) validates that README.md and I18N.md reflect the real locale count. Adding zh-TW bumped the count from 42 → 43. * fix(i18n): translate providers free-filter labels in zh-TW (#6694 guard) Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com> Co-authored-by: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com> Co-authored-by: lunkerchen <lunkerchen@users.noreply.github.com> * feat(proxy): implement latency-optimized proxy rotation strategy (#6798) * feat(proxy): implement latency-optimized proxy rotation strategy Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR) and the direct CHANGELOG.md edit (fragments-first); the author's env/docs/i18n deltas were re-applied cleanly onto the release tip. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * fix(proxy): add latency-rotation env var to .env.example PROXY_LATENCY_WINDOW_HOURS was referenced in src/lib/db/proxies.ts and documented in docs/reference/ENVIRONMENT.md, but missing from .env.example, tripping the env/docs sync gate. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * chore(changelog): re-sync CHANGELOG.md to release tip Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * refactor(proxy): extract latency-strategy helpers to keep frozen files under cap Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * test(db-rules): expect 35 audited modules (proxyLatency joins INTENTIONALLY_INTERNAL) Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * docs(readme): fix stale strategy/tool/scoring counts (#6853) README still claimed 17 routing strategies (the table was missing pipeline), 95 MCP tools, and 9-factor Auto-Combo scoring. Align with the source (ROUTING_STRATEGY_VALUES has 18 entries) and the canonical docs (MCP-SERVER.md: 94 tools; AUTO-COMBO.md: 12-factor). * fix(antigravity): sanitize Cloud Code safety settings (#6839) Co-authored-by: kfiramar <83420275+kfiramar@users.noreply.github.com> * fix(kiro): probe IdC region during profileArn discovery, cross-region (recovers #6099) (#6840) * fix(kiro): route Amazon Q runtime by profileArn region for cross-region IdC Enterprise AWS IAM Identity Center accounts whose IdC instance lives outside the two Amazon Q Developer profile regions (us-east-1 / eu-central-1) - e.g. eu-north-1 (Stockholm), start URL https://d-XXXX.awsapps.com/start - showed no limits and returned 502 on every request. Root cause: the backend used the IdC/OIDC token region (providerSpecificData.region, e.g. eu-north-1) for every CodeWhisperer runtime call, hitting q.eu-north-1.amazonaws.com - a host that does not exist as a Q Developer runtime endpoint. Per AWS docs ("Supported Regions for the Q Developer console and Q Developer profile"), the Q Developer *profile* (which produces the profileArn and hosts generateAssistantResponse / GetUsageLimits / ListAvailableModels / ListAvailableProfiles) is only hosted in us-east-1 and eu-central-1, regardless of the IdC region; "data is stored in the Region where you create the Amazon Q Developer profile." Fix (new open-sse/services/kiroRegion.ts) decouples the two regions: - providerSpecificData.region stays the IdC/OIDC region, used ONLY for oidc.{region}.amazonaws.com token mint/refresh. - The runtime region is derived from the profileArn (resolveKiroRuntimeRegion): profileArn region -> a valid stored profile region -> us-east-1. A stored IdC region that is not a Q profile region (eu-north-1) is ignored for runtime. - Profile discovery (discoverKiroProfileArnAcrossRegions) probes the Q profile regions (EU IdC -> eu-central-1 first) with the cross-region SSO token instead of q.{idcRegion}. Wired into: executors/kiro.ts (generateAssistantResponse targets the profile region), services/usage/kiro.ts (getKiroUsage multi-region discovery + profileArn runtime region so Limits resolves), services/kiroModels.ts (ListAvailableModels), and src/lib/oauth/providers/kiro.ts (login-time postExchange profile discovery). Adds tests/unit/kiro-idc-cross-region.test.ts (15 cases). All Kiro suites pass (60 tests). * fix(kiro): probe the IdC region too during profileArn discovery (any IdC region) Make profile discovery general for an IdC in ANY of the ~30 IdC-supported AWS regions (us-west-2, ap-southeast-2, me-central-1, af-south-1, ...), not just eu-north-1. buildKiroProfileDiscoveryRegions now probes the two documented Q Developer profile regions FIRST (us-east-1 / eu-central-1, EU-first for EMEA IdC regions to cut latency), then appends the IdC/stored region itself as a forward-compatible fallback: if AWS ever co-locates the profile with the IdC or expands the profile-region list, a same-region probe still finds it. Probing a region with no profile simply returns nothing and we fall through. The profileArn's own region remains authoritative for every runtime call (resolveKiroRuntimeRegion), so a newly-issued ARN in any region is honored automatically. Adds ap-southeast-2 (APAC) cross-region coverage and updates the discovery-order tests. --------- Co-authored-by: artickc <artur1992123@mail.ru> * feat(providers): manual context-window override for custom models (#4125) (#6822) Add a manual per-model "Context Window Override" so an operator can correct a provider's misreported context length (e.g. reports 1M when the real limit is 128K) instead of the model getting silently dropped from combo routing once the wrong value lands in the catalog. Reuses the existing Feature-5004 model_context_overrides table (source="manual") — already the priority-0 source getModelContextLimit() (the function combo's context-window filter calls) reads ahead of the models.dev/registry/static catalog — so no new resolver logic was needed, only the missing write path: - PUT /api/provider-models now accepts an optional contextWindowOverride (number to set, null to clear), persisted via setModelContextOverride/ removeModelContextOverride. - GET /api/provider-models surfaces the current override value + source back on each custom-model row. - CustomModelsSection.tsx: edit form gained a Context Window Override input + a badge on the model row when an override is set. Regression guard: tests/unit/provider-models-context-window-override-4125.test.ts (manual override wins over a misreported catalog value, GET round-trip, clearing via null, default-unchanged behavior). * feat(dashboard): improve Provider Quota page horizontal density (#3520) (#6815) QuotaCardGrid stacked every provider group vertically in a single flex flex-col container, and each group's own card grid didn't go multi-column until the md breakpoint. Provider groups now flow into a 2-column CSS multi-column layout on very wide (2xl) screens instead of an unconditional vertical stack, and each group's card grid starts at 2 columns immediately, filling horizontal whitespace sooner on narrower-but-not-mobile viewports. Regression guard: tests/unit/quota-card-grid-horizontal-layout.test.ts * refactor(usage): type saveRequestUsage with UsageEntry interface + any-budget ratchet (#3512) (#6809) Replace saveRequestUsage(entry: any) with a typed UsageEntry interface mirroring the usage_history columns 1:1. Fields stay optional/nullable since different writers (chatCore success/failure, rejected-request accounting, Codex Responses WS) populate the row incrementally; tokens stays unknown since callers pass either raw provider-shaped usage or the normalized {input,output,cacheRead,...} shape. Also cleaned the file's other any usages (getUsageHistory filter, getUsageDb next-cursor cast, appendRequestLog tokens param, getRecentLogs catch) so it now sits at zero any and can be added to the check:any-budget:t11 zero-any allowlist. Documents the DB-entity <-> TS-interface convention in docs/architecture/CODEBASE_DOCUMENTATION.md Sec 11. * feat(combo): strict budget-cap fallback policy for auto/* combos (#3470) (#6816) Auto-combo transparency + budget controls: the engine's budgetCap enforcement always degraded to the globally cheapest candidate when every candidate exceeded the cap - silently overspending instead of respecting the cap. - engine.ts: budgetFallback "cheapest" (default, legacy) | "strict" (BudgetExceededError when no candidate fits budgetCap) - requestControls.ts: X-OmniRoute-Budget-Fallback header + resolveRequestAutoControls() consolidating mode/budget/fallback parsing - resolveAutoStrategy.ts / autoConfig.ts: thread combo-level config.budgetFallback and catch BudgetExceededError into an HTTP 402 - chat.ts: switch to the consolidated resolveRequestAutoControls() helper (net line reduction, stays under the frozen file-size baseline) Regression guard: tests/unit/auto-combo-budget-fallback-3470.test.ts * fix(usage): honor xAI provider-reported exact cost (#6711) OmniRoute's calculateCost() always estimated request cost from token counts x static pricing, discarding xAI's exact provider-reported cost when present. xAI's chat-completions usage object reports the precise billed cost via cost_in_usd_ticks (docs.x.ai/developers/cost-tracking and the API reference's usage schema: "TICKS_IN_USD_CENT: i64 = 100_000_000" => 1e10 ticks/USD, e.g. 37756000 ticks ~= $0.0038). calculateCost()/computeCostFromPricing() now short-circuit to this exact figure when present -- before any pricing DB lookup, so it also works for models without a local pricing row -- and still fall back to the token-based estimate when it is absent. The field is threaded through both the streaming (extractUsage/normalizeUsage) and non-streaming (extractUsageFromResponse) usage-extraction paths. Corrected divisor vs upstream: the upstream PR used /1e12 (a 100x under-report, e.g. reporting $0.00123 as the doc's $0.123 example); this port uses the doc-verified /1e10 instead, confirmed against both the cost-tracking guide and the API reference's usage-object schema. Inspired-by: https://github.com/decolua/9router/pull/2453 Co-authored-by: ryanngit <74137224+ryanngit@users.noreply.github.com> * docs: rename /implement-prs → /merge-prs in Hard Rule #21 (skill renamed 2026-07-11) (#6847) * docs: refresh stale llm.txt facts + relocate design.md to docs/architecture/DESIGN_SYSTEM.md (#6849) * docs: refresh stale llm.txt facts + move design.md to docs/architecture/DESIGN_SYSTEM.md llm.txt was frozen at the v3.8.8 era (177 providers, 37 MCP tools, 14 strategies, 9-factor scoring, 75% coverage gate). Update every factual claim to the current state (248 providers, 94 tools / 30 scopes, 18 strategies, 12-factor scoring, ratchet + 60% floor, TS 6, current docs/ layout) and re-sync the 42 exact-copy i18n mirrors. design.md at the root was a standardization plan whose phases 1-6 all shipped; rewrite its header as a permanent reference and relocate it to docs/architecture/DESIGN_SYSTEM.md per the root-hygiene policy (root = configs + canonical docs only). * docs: add MDX frontmatter to DESIGN_SYSTEM.md (in-app docs pipeline requires it) * 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) * feat: sidebar search/filter input (#4013) (#6810) * feat(dashboard): add search/filter input to the dashboard sidebar (#4013) Adds a search box at the top of the expanded sidebar that filters nav sections/groups/items client-side by label, so users don't have to hunt through the growing nav tree. Reuses the existing common.search / common.noResults i18n keys (no new locale edits needed) and the shared Input icon="search" pattern. Matching sections auto-expand while searching and the accordion/pin state is restored once the query is cleared. Filtering logic is extracted into a pure filterSidebarSectionsByQuery() helper (src/shared/utils/sidebarSearch.ts) so it is trivially unit testable independent of React/next-intl/next-navigation. * fix(test): move Sidebar.search test to a runner-collected path (test-discovery gate) * fix(i18n): backfill 194 missing pt-BR keys (#6695) (#6723) * fix(i18n): backfill 194 missing pt-BR keys and add key-parity regression test (#6695) * Merge branch 'release/v3.8.47' into fix/6695-i18n-drift Resolve i18n key-parity and CHANGELOG-fragment conflicts: - Convert the #6695 CHANGELOG.md bullet to a changelog.d/ fragment (the fragment convention landed on release/v3.8.47 after this PR branched, per changelog.d/README.md). - Backfill 61 additional pt-BR keys that entered en.json on release/v3.8.47 after this PR's original 194-key backfill, so the PR's own key-parity regression test (tests/unit/i18n-pt-br.test.ts) stays green against the moving release baseline. * Discover live Codex models (#6776) * Add live model discovery for provider catalog * Fix model discovery request headers * fix(codex): sync live model limits with local catalog * test(codex): split live model discovery coverage into dedicated route tests * fix(codex): use chatgpt account id for live model sync * Add GitHub-backed Codex model discovery fallback * fix(providers): tighten oauth config tests and provider model display comments * test: align client version expectations with release default * fix(codex): keep discovery complexity within baseline * fix: rebase live Codex model discovery onto release/v3.8.47, preserving kimi-web buildHeaders (#6308) Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --------- Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * feat(codex): echo requested effort-suffixed model id in Responses payloads (#3697) (#6820) * feat(codex): echo requested effort-suffixed model id in Responses payloads (#3697) Codex CLI compatibility shim: the Responses API response.created/ response.in_progress/response.completed payloads now carry a `model` field (previously absent), and for Codex-CLI-originated requests it echoes the client-requested effort-suffixed model id (e.g. gpt-5.5-xhigh) instead of the bare upstream id (gpt-5.5), so the Codex CLI status line/model button shows the active reasoning effort. - openai-responses.ts translator threads the upstream model into the Responses event objects (additive, omitted when unknown). - New isCodexOriginatedHeaders() (codexIdentity.ts) reuses PR #3481's originator/User-Agent detection, header-based so it still fires when a combo routes codex/gpt-5.5-xhigh to a non-codex upstream. - chatCore's existing opt-in #1311 echoModel pipeline now also fires automatically for Codex clients on the Responses API, regardless of the echoRequestedModelName setting. - responseModelEcho.ts now also rewrites the nested response.model field the Responses API uses (previously only top-level model). - /v1/models keeps returning models: [] for Codex (unchanged, #3481). Regression guard: tests/unit/codex-effort-model-echo-3697.test.ts. Closes #3697 * chore(merge): re-sync with release/v3.8.47 (restore CHANGELOG, keep own bullet) * chore(merge): re-sync with release/v3.8.47; move changelog bullet to changelog.d fragment (merge-storm proof) * feat(usage): surface Antigravity weekly quota alongside the 5-hour window (#4017) (#6818) * feat(usage): surface Antigravity weekly quota alongside the 5-hour window (#4017) Antigravity enforces both a 5-hour and a weekly usage limit, but the agy/antigravity quota widget only exposed the 5-hour window. The weekly limit isn't in the per-model retrieveUserQuota response already fetched — it lives in a separate, undocumented retrieveUserQuotaSummary RPC that groups models into families (Gemini Models, Claude and GPT models) with one weekly bucket per family. Adds a self-contained usage/antigravityWeeklyQuota.ts leaf: a cached, best-effort fetch of that RPC + a pure parser that extracts the weekly-labeled bucket per group (window inferred from bucketId/displayName text, matching the reverse-engineered shape documented by third-party Antigravity clients) into gemini_weekly/ claude_gpt_weekly quota entries, merged into the existing quotas map the widget already renders generically. A failed/unavailable RPC never affects the existing per-model quotas. Live VPS validation attempt (192.168.0.15, real antigravity account): both retrieveUserQuota and retrieveUserQuotaSummary currently return 429 RESOURCE_EXHAUSTED for that account, so the live response shape could not be captured directly. The parser was instead validated via TDD against the bucket shape documented by CodexBar (steipete/CodexBar), a third-party Antigravity client that reverse-engineered the same RPC, and is defensive against both response envelopes it has observed (top-level groups[] and nested quotaSummary.groups[]). * chore(merge): re-sync with release/v3.8.47 (restore CHANGELOG, keep own bullet) * chore(merge): re-sync with release/v3.8.47; move changelog bullet to changelog.d fragment (merge-storm proof) * feat: add Z.ai Web free web-cookie provider (#4056) (#6823) * feat(providers): add Z.ai Web free web-cookie provider (#4056) New zai-web web-session provider drives the free chat.z.ai consumer chat UI via a pasted browser cookie, distinct from the existing API-key zai/glm/glm-cn/glmt providers (api.z.ai). ZaiWebExecutor posts to chat.z.ai/api/chat/completions with the cookie forwarded both as Cookie and Authorization: Bearer <token>, and normalizes both z.ai's internal delta_content/phase SSE envelope and a pass-through OpenAI-shaped choices[].delta frame into standard chat-completion chunks. Registered in WEB_COOKIE_PROVIDERS, WEB_SESSION_CREDENTIAL_REQUIREMENTS, the provider registry (GLM-4.6/4.5/4.5V models), the executor factory, and tokenExtractionConfig.ts for in-app cookie capture. * fix(providers): regenerate translate-path golden for zai-web + reduce cognitive complexity * fix(providers): rename ZaiWebExecutor.buildHeaders to avoid incompatible BaseExecutor override * chore(merge): re-sync with release/v3.8.47; move changelog bullet to changelog.d fragment (merge-storm proof) * fix(codex): bump default client version to 0.144.0 (#6780) Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> * refactor(usage): extract per-group parsing in antigravityWeeklyQuota (cognitive-complexity gate 886→885, release-level drift from #6818 merge) * ci(quality): cut PR gate wall time without dropping protection (#6716) Collapse duplicate CI spend while keeping each gate's existence reason: - quality.yml: TIA __RUN_ALL__ defers full unit to fast-unit 4-shard (#6781); path filters via classify-pr-changes; docs-gates split; draft skip - ci.yml: wire docs/i18n/code path filters; ESLint JSON artifact for quality-gate; drop advisory typecheck:noimplicit; float actions/cache@v6 - TIA parity: memory/usage/combo/serial; **/*.test.mjs any depth; electron/bin no longer force unit __RUN_ALL__ - check:complexity-ratchets: one ESLint walk, ruleId-isolated baselines + cache - check:api-docs-refs + lib/apiRoutes: shared API route inventory - husky pre-push: intentionally light (gates live in pre-commit); CLAUDE.md + QUALITY_GATES.md docs synced - collect-metrics / lint:json: path.resolve cache path; Windows-safe eslint bin - env-doc allowlist for ESLINT_RESULTS_JSON / COMPLEXITY_ESLINT_REPORT - release-green --full-ci expects check:api-docs-refs (not docs-symbols alone) Tests: select-impacted, classify-pr-changes, api-routes lib, complexity-rule-count, validate-release-green. Reconciled after #6781 (fast-unit 2→4 shards) per maintainer request on #6716. Co-authored-by: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com> * fix(docs): document Turbopack build memory tradeoff for RAM-constrained machines (#6409) (#6885) * fix(routing): recognize Kimi token-limit 400 as context overflow for combo fallback (#6637) (#6893) combo.ts's isContextOverflow400() guard required the literal word 'context' in the 400 error body before letting a combo fall through to the next target. Kimi's exact wording ('Your request exceeded model token limit: 262144 (requested: 308458)') never says 'context', so the guard misclassified it as a body-specific error and halted the whole combo instead of trying the next (larger-context) target. accountFallback.ts's CONTEXT_OVERFLOW_PATTERNS already recognized this wording one layer below (via checkFallbackError -> shouldFallback), so the two independently-maintained classifiers disagreed and the stricter one won. Export CONTEXT_OVERFLOW_PATTERNS from accountFallback.ts and reuse it inside combo.ts's isContextOverflow400() so both layers share a single source of truth. Regression test: tests/unit/repro-6637-kimi-token-limit.test.ts (RED on unfixed code -> GREEN after the fix). Existing #4519 guard tests (tests/unit/combo-param-validation-fallback-4519.test.ts) still pass, including the negative case that a genuinely body-specific 400 is NOT misclassified as overflow. * fix(providers): honor a provider-level proxy assigned to no-auth providers (#6272) (#6895) No-auth providers (mimocode, opencode, ...) are always dispatched with a single hardcoded connectionId ("noauth" — SYNTHETIC_NOAUTH_CONNECTION_ID in src/sse/services/auth.ts). No provider_connections row ever has id="noauth", so resolveProxyForConnection() in src/lib/db/settings.ts could never populate connectionRecord for them, and its provider-level proxy lookup (Steps 6/8) only runs when connectionRecord is present. A proxy assigned via Settings -> Providers -> mimocode was therefore silently ignored, reproducing the reporter's "same thing happen when i set the proxy directly in the provider menu" symptom. Adds a best-effort fallback (src/lib/db/settings/noAuthProxyFallback.ts): when connectionRecord could not be resolved, scan the known no-auth provider ids for a configured provider-level proxy (registry first, then legacy) before falling through to the global/direct steps. Regression test: tests/unit/proxy-noauth-provider-6272.test.ts (RED on unfixed code — resolved to level=direct/proxy=null; GREEN after the fix). * fix(dashboard): surface Claude extraUsage credits in quota card (#6806) (#6896) Enterprise-tier Claude accounts (default_raven_enterprise) don't get five_hour/seven_day utilization windows from Anthropic's OAuth usage endpoint — only an extra_usage credit-billing block. parseClaude() only read data.quotas, so quotas stayed {} and the dashboard showed "No quota data" even when extraUsage showed the account 100% exhausted. parseClaude() now folds an enabled extraUsage block into a credits-style quota row (mirroring parseCodex's bankedResetCredits pattern), both when quotas is empty and when it's already populated. * fix(db): share sql.js preinit across callers, fix named-param bind (#6628, #6802) (#6899) - preInitSqlJs() now memoizes an in-flight Promise (not just the resolved adapter) per filePath, so concurrent BATCH/STARTUP/HealthCheck/ ProviderLimitsSync callers at boot share one full-file read+WASM decode instead of each independently reloading the whole database — the thundering-herd amplifier of the OOM condition #6632 already partly fixed, left un-implemented by the reporter's own proposed fix (#6628). - sqljsAdapter's run/get/all now unwrap a lone named-parameter object (e.g. .all({ isActive: 1 }) for "WHERE is_active = @isActive", the same call shape getProviderConnections() already uses against better-sqlite3) before calling sql.js's stmt.bind(), expanding it to the @/:/$ sigil variants sql.js's own named-bind path requires. Previously the object was wrapped into an array and sql.js took the positional-bind path, throwing "Wrong API use : tried to bind a value of an unknown type ([object Object])." whenever the sql.js WASM fallback driver was active — exactly the error #6802 reported (misattributed to better-sqlite3). Regression tests added to tests/unit/db-adapters/driverFactory.test.ts and tests/unit/db-adapters/sqljsAdapter.test.ts, both proven RED against the prior code and GREEN after the fix. * fix(plugin): split OC-gate provider id from OmniRoute-facing routing id (#6859) (#6900) resolveOmniRoutePluginOptions() auto-prefixes providerId with "opencode-" (commit75b52e286) so OpenCode 1.17.8+'s native-adapter gate accepts it as a registered provider id. That prefixed value was being reused for the OmniRoute-server-facing identifiers too: mapRawModelToModelV2's id/providerID, mapComboToModelV2's providerID, and the dynamic provider hook's combo catalog keys. OmniRoute's server has no "opencode-<x>" provider alias, so every dispatched model failed credential lookup with "No credentials for opencode-omniroute" / "No active credentials for provider: opencode-omniroute". Add a … * test(ci): static body in codex e2e mock route bridge (CodeQL #737) (#7559) CodeQL js/stack-trace-exposure flags ANY error-derived value returned in the mock route bridge's 500 path, not just error.stack — swapping .stack for error.message (in #7354, alert #736) left sibling alert #737 open on the same line. Replace the body with a static string; the test only asserts status===200, so the 500 body is never inspected. Clears the last open CodeQL alert repo-wide, unblocking the Quality Ratchet on every PR. Companion to the release/v3.8.49 PR (merge-gates §8 — gate/CI-touching fix lands on main in the same session). * fix(security): bump adm-zip >=0.6.0 + exact host matching in mitm DNS test (#7733) * feat(sse): add PromptQL playground provider (unofficial) Reverse-engineered prompt.ql.app session bridge: - GraphQL start_thread / send_thread_message + poll thread_events for AgentMessage - Sticky thread_id for OpenAI multi-turn (X-PromptQL-Thread-Id) - Live FetchLlmConfigs catalog with offline seed fallback - Credits via promptql_project_credit_summary (USD micros to Limits) - Optional JWT refresh via auth.pro.ql.app (requires session cookie; verify in prod) NOTE: token refresh against auth.pro.ql.app/ddn/project/token still needs production verification with real browser session cookies. * feat(promptql): live FetchLlmConfigs model discovery on providers API Wire promptql/pql into /api/providers/[id]/models like notion-web: JWT → GraphQL FetchLlmConfigs; seed catalog fallback when missing/expired. * fix(promptql): surgical models discovery patch on main Replace polluted models/route.ts copy with a clean origin/main-based patch that only adds PromptQL FetchLlmConfigs discovery. * fix(promptql): sticky multi-turn by history prefix + surface USD credits on Limits Thread continuity (SkillsManager / multi-session): - Root cause: cache key was sha256(projectId + first user message only). Shared greetings and agentic/UREW system pins made unrelated chats collide, so a follow-up was randomly send_thread_message'd into an older PromptQL thread. - Fix: prefer body.promptql_thread_id / X-PromptQL-Thread-Id; else fingerprint the full non-system history prefix (messages before last user, requiring prior assistant content). First turn always start_thread. After each reply, store under fingerprint(full history + assistant) for the next prefix match. - Stale client thread ids fall back to start_thread instead of guessing another sticky hit. System/developer/tool roles are excluded from fingerprints. Limits page (getCreditSummary already implemented but never synced): - promptql/pql were missing from USAGE_SUPPORTED_PROVIDERS, PROVIDER_LIMITS_APIKEY_PROVIDERS, and USAGE_FETCHER_PROVIDERS, so isSupportedUsageConnection returned false for JWT/apikey PromptQL connections and /api/usage/provider-limits never cached quotas.credits USD. - Registered all three allowlists so scheduled + manual limits sync call getPromptQlUsage (micros → USD). Tests: 18/18 executor-promptql (5 new continuity cases + allowlist guard). * fix(sse): mechanical pre-merge fixes for PromptQL provider (#7911) Docs/env sync for the 4 new PROMPTQL_* env vars, regenerate the translate-path GOLDEN snapshot for the new provider, fix a promptql model-discovery type narrowing error, and restore CHANGELOG.md / eslint-suppressions.json to the release tip (both were incorrectly resolved to the PR's stale branch copy during the merge). Co-authored-by: artickc <artur1992123@mail.ru> Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouzapw@users.noreply.github.com> * fix(promptql): credits micros display + multi-turn sticky against rewrites Follow-up for #7911 against live SPA captures (ge_balance / send1 / send2): Credits (Limits card showed 100%/0 used): - Map available/drawn/remaining micros to total/used/remaining USD - displayName Credits (USD); resetAt null (last_drawdown is not a hard reset) - Optional Cookie header + better HTTP error bodies for getCreditSummary Thread continuity (every multi-turn started a new chat): - normalizeForFingerprint strips agent_mention + User request: wrappers - last-assistant rolling sticky key survives UREW last-user rewrites - tighten send_thread dead-thread fallback (no bare 400/invalid match) Tests: 21/21 executor-promptql * fix(promptql): dual JWT credits + tool-result multi-turn sticky Live diagnosis after #7911 packaging: Credits (0 used / 100% remaining): - Real playground JWT often is DDN/lux (iss=auth.pro.hasura.io) with project id only in aud — not x-hasura-project-id. Extract aud UUID for projectId. - data.pro.ql.app getCreditSummary accepts DDN tokens; enrich-token is rejected. - Prefer providerSpecificData.luxJwt/ddnToken for credits; pass connection.projectId. - Clear dual-token messages when only enrich is present. Chat (Missing projectId + tool follow-ups starting new threads): - Reject DDN-only tokens for playground with paste-enrich instructions. - Sticky keys: last-assistant text + tool-name signature; read OpenAI tool_calls when content is null; treat tool/function as turn boundaries. - normalizeForFingerprint strips soft pin, tool-result wrappers, @mentions. Tests: 30/30 executor-promptql (tool_calls sticky, DDN aud, luxJwt credits). * refactor(sse): split promptql executor into semantic leaf modules (file-size cap) open-sse/executors/promptql.ts had grown to 1283 lines (cap 800 for new/tracked files). Split by responsibility, no behavior change: - open-sse/services/promptql/jwt.ts: JWT decode/expiry, project-id extraction, token classification (playground vs DDN/lux), resolvePromptQlCredentials. Also de-dupes decodeJwtPayload/extractProjectIdFromToken, previously copy-pasted into open-sse/services/usage/promptql.ts (flagged in review) — that file now imports the shared helpers instead of reimplementing them. - open-sse/executors/promptql/messageText.ts: OpenAI message/content text extraction (content parts, tool_calls, function_call). - open-sse/executors/promptql/eventTree.ts: AgentMessage event-tree walk + final_response XML fallback parsing. - open-sse/executors/promptql/threadSticky.ts: multi-turn thread session cache (fingerprinting, disk/memory binding store, resolve/store). The executor keeps the GraphQL client, queries, and PromptQlExecutor class wiring (now 698 lines). All original exports remain reachable from the executor module (re-exported) so no consumer/test import changed. Also fixes two defects surfaced while revalidating the two commits the author pushed on top of the last pre-green: - open-sse/services/promptqlModels.ts: discoverPromptQlModels()'s .map/.filter pair failed typecheck (TS2322/TS2677) because the mapped literal's inferred type didn't structurally match PromptQlModel's optional configId — annotate the map callback's return type instead of `satisfies`. - src/lib/usage/providerLimits.ts: registering the promptql/pql apikey-limits providers pushed this frozen-at-1000-lines file to 1001; reflowed the new entries onto one fewer line to stay within the frozen cap (no baseline bump). Validated: typecheck:core clean, eslint clean on touched files, check:cycles (explicit open-sse/executors + open-sse/services roots) shows no promptql file in any cycle, file-size gate OK (0 violations), golden provider translate-path test green, check-env-doc-sync clean (only the pre-existing, unrelated OMNIROUTE_DATA_DIR gap remains), check-changelog-integrity OK, tests/unit/executor-promptql.test.ts 30/30 passing (byte-equivalent asserts). Co-authored-by: artickc <artur1992123@mail.ru> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com> Co-authored-by: growab <nekron@icloud.com> Co-authored-by: KooshaPari <42529354+KooshaPari@users.noreply.github.com> Co-authored-by: Chirag Singhal <76880977+chirag127@users.noreply.github.com> Co-authored-by: Chirag Singhal <chirag127@users.noreply.github.com> Co-authored-by: Ronaldo Davi <ronaldodavi@gmail.com> Co-authored-by: Andrew Munsell <andrew@wizardapps.net> Co-authored-by: WITALO ROCHA <witalo_rocha@hotmail.com> Co-authored-by: Wital <witalorocha216@gmail.com> Co-authored-by: Aoxiong Yin <i@yinaoxiong.cn> Co-authored-by: Andrew B. <37745667+AndrianBalanescu@users.noreply.github.com> Co-authored-by: Andrian B. <andrewbalanesq@gmail.com> Co-authored-by: Xiangzhe <32761048+xz-dev@users.noreply.github.com> Co-authored-by: Jon Bailey <297513015+Pitchfork-and-Torch@users.noreply.github.com> Co-authored-by: Pitchfork-and-Torch <Pitchfork-and-Torch@users.noreply.github.com> Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com> Co-authored-by: Samir Abis <me@samirabis.com> Co-authored-by: lucasjustinudin <34107354+lucasjustinudin@users.noreply.github.com> Co-authored-by: chy1211 <31048289+chy1211@users.noreply.github.com> Co-authored-by: ryanngit <74137224+ryanngit@users.noreply.github.com> Co-authored-by: whale9820 <whale9820@users.noreply.github.com> Co-authored-by: anhdiepmmk <n08ni.dieppn@gmail.com> Co-authored-by: Septianata Rizky Pratama <19322988+ianriizky@users.noreply.github.com> Co-authored-by: backryun <bakryun0718@proton.me> Co-authored-by: lunkerchen <labanchen@gmail.com> Co-authored-by: lunkerchen <lunkerchen@users.noreply.github.com> Co-authored-by: Ray Doan <raydoan.contact@gmail.com> Co-authored-by: kfiramar <83420275+kfiramar@users.noreply.github.com> Co-authored-by: Jan Leon <Jan.gaschler@gmail.com> Co-authored-by: Someres <168349709+quanturbo@users.noreply.github.com> Co-authored-by: MikeTuev <ra9ftm@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Imam Wahyu Widodo <120608486+hajilok@users.noreply.github.com> Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com> Co-authored-by: AgentKiller45 <jamalzzj45@gmail.com> Co-authored-by: judy459 <JUDYZHU459@outlook.com> Co-authored-by: Diego Rodrigues de Sa e Souza <souzamiriamrodrigues790@gmail.com> Co-authored-by: Markus Hartung <mail@hartmark.se> Co-authored-by: KooshaPari <koosha@phenotype.io> Co-authored-by: Jade Guo <jade.gly@gmail.com> Co-authored-by: Paijo <14921983+oyi77@users.noreply.github.com> Co-authored-by: oyi77 <oyi77@users.noreply.github.com> Co-authored-by: Dayna Blackwell <dayna@blackwell-systems.com> Co-authored-by: backryun <backryun@daonlab.local> Co-authored-by: brick30llc-ctrl <brick30llc@gmail.com> Co-authored-by: brick30llc-ctrl <admin@brick30.com> Co-authored-by: Saren <saren@dumstruck.com> Co-authored-by: Rafael Dias Zendron <mmmarckos@gmail.com> Co-authored-by: Xiangzhe <xiangzhedev@gmail.com> Co-authored-by: Rafael Dias Zendron <rafael.zendron22@gmail.com> Co-authored-by: KooshaPari <62650152+KooshaPari@users.noreply.github.com> Co-authored-by: Wibias <37517432+Wibias@users.noreply.github.com> Co-authored-by: huohua-dev <celentanohertor@gmail.com> Co-authored-by: huohua-dev <258873123+huohua-dev@users.noreply.github.com> Co-authored-by: CitrusIce <31264099+CitrusIce@users.noreply.github.com> Co-authored-by: minisforum <no@mail.com>
258 KiB
title, version, lastUpdated
| title | version | lastUpdated |
|---|---|---|
| Environment Variables Reference | 3.8.40 | 2026-06-28 |
Environment Variables Reference
Complete reference for every environment variable recognized by OmniRoute. For a quick-start template, see
.env.example.
Important
Every variable documented here must also appear in
.env.example, and every variable in.env.examplemust appear here.npm run check:env-doc-syncenforces this on commit and in CI. To omit a variable on purpose, add it to the allowlist insidescripts/check/check-env-doc-sync.mjs.
Table of Contents
- 1. Required Secrets
- 2. Storage & Database
- 3. Network & Ports
- 4. Security & Authentication
- 5. Input Sanitization & PII Protection
- 6. Tool & Routing Policies
- 7. URLs & Cloud Sync
- 8. Outbound Proxy
- 9. CLI Tool Integration
- 10. Internal Agent & MCP Integrations
- 11. OAuth Provider Credentials
- 12. Provider User-Agent Overrides
- 13. CLI Fingerprint Compatibility
- 14. API Key Providers
- 15. Timeout Settings
- 16. Logging
- 17. Memory Optimization
- 18. Pricing Sync
- 19. Model Sync (Dev)
- 20. Provider-Specific Settings
- 21. Proxy Health
- 22. Debugging
- 23. GitHub Integration
- 24. Skills Sandbox (v3.8.0+)
- Deployment Scenarios
- Audit: Removed / Dead Variables
1. Required Secrets
These must be set before the first run. Without them, the application will either refuse to start or operate with insecure defaults.
| Variable | Required | Default | Source File | Description |
|---|---|---|---|---|
JWT_SECRET |
Yes | (none) | src/lib/auth |
Signs/verifies all dashboard session cookies (JWT). Generate with openssl rand -base64 48. |
API_KEY_SECRET |
Yes | (none) | src/lib/db/apiKeys.ts |
AES encryption key for API key values at rest in SQLite. Generate with openssl rand -hex 32. |
INITIAL_PASSWORD |
Yes | CHANGEME |
Bootstrap script | Sets the initial admin dashboard password (matches .env.example default — kept obviously insecure to force a change). Change before first use. After login, change via Dashboard → Settings → Security. |
OMNIROUTE_WS_BRIDGE_SECRET |
Yes (production) | (unset) | src/app/api/internal/codex-responses-ws/route.ts |
Shared secret for the internal Codex Responses WebSocket bridge. Authenticates bridge requests between the Electron/browser WS relay and OmniRoute. ⚠️ REQUIRED in production — when unset, all WS bridge requests are rejected. Generate with openssl rand -base64 32. |
OMNIROUTE_PEER_STAMP_TOKEN |
No (auto) | (auto per boot) | src/server/authz/policies/management.ts |
Per-process secret proving the trusted peer-IP stamp came from OmniRoute's own HTTP server (scripts/dev/peer-stamp.mjs). The authz middleware trusts request locality (loopback/LAN gating of LOCAL_ONLY routes) only when the stamp carries this token. Auto-generated each boot — leave unset; only pin it for multi-process setups that must share the stamp. |
Generation Commands
# Generate all four secrets at once:
echo "JWT_SECRET=$(openssl rand -base64 48)"
echo "API_KEY_SECRET=$(openssl rand -hex 32)"
echo "INITIAL_PASSWORD=$(openssl rand -base64 16)"
echo "OMNIROUTE_WS_BRIDGE_SECRET=$(openssl rand -base64 32)"
Caution
Never commit
.envfiles with real secrets to version control. The.gitignorealready excludes.env, but verify before pushing.
2. Storage & Database
OmniRoute uses SQLite (via better-sqlite3) for all persistence. These variables control data location, encryption, and lifecycle.
| Variable | Default | Source File | Description |
|---|---|---|---|
DATA_DIR |
~/.omniroute/ |
src/lib/db/core.ts |
Root directory for SQLite DB, backups, and data files. Override for Docker volumes or custom paths. |
STORAGE_ENCRYPTION_KEY |
(empty = disabled) | src/lib/db/encryption.ts |
AES key for full SQLite database encryption at rest. Generate with openssl rand -hex 32. |
STORAGE_ENCRYPTION_KEY_VERSION |
v1 |
scripts/build/bootstrap-env.mjs, electron/main.js |
Version label for the encryption key. Increment when performing key rotation to support decryption of old backups. |
DISABLE_SQLITE_AUTO_BACKUP |
false |
src/lib/db/backup.ts |
When true, skips the automatic database backup that runs before migrations on every startup. |
OMNIROUTE_CRYPT_KEY |
(unset) | src/lib/db/encryption.ts |
Legacy alias for STORAGE_ENCRYPTION_KEY. Accepted as a fallback when the primary variable is absent. |
OMNIROUTE_API_KEY_BASE64 |
(unset) | src/lib/db/encryption.ts |
Legacy alias (Base64-encoded form) accepted as a fallback. Decoded automatically before use. |
OMNIROUTE_DB_HEALTHCHECK_INTERVAL_MS |
(unset) | src/lib/db/core.ts |
Override the periodic SQLite healthcheck interval (ms). When unset, defaults are derived from NODE_ENV. |
OMNIROUTE_SKIP_DB_HEALTHCHECK |
0 |
src/lib/db/core.ts, src/lib/db/healthCheck.ts |
Set to 1 to skip the DB healthcheck entirely on startup. Useful for short-lived tasks and integration tests. |
OMNIROUTE_FORCE_DB_HEALTHCHECK |
0 |
src/lib/db/core.ts |
Set to 1 to force the DB healthcheck loop on, even when it would normally be skipped (e.g., short-lived tasks). |
OMNIROUTE_SKIP_POSTINSTALL |
0 |
scripts/postinstall.mjs |
Set to 1 to skip the native-runtime warm-up during npm install. Useful in CI/headless installs where sqlite is already built. |
OMNIROUTE_MIGRATIONS_DIR |
(auto-detect) | src/lib/db/migrationRunner.ts |
Override the directory that the migration runner scans. Useful when shipping bundled migrations in custom builds. |
OMNIROUTE_MAX_PENDING_MIGRATIONS |
50 |
src/lib/db/migrationRunner.ts |
Mass-pending-migrations safety threshold (#3416). Startup aborts if more than this many migrations are pending on an existing DB (guards against a wiped tracking table). Raise it to restore an older backup; set to 0 to disable the check. |
OMNIROUTE_SPEND_FLUSH_INTERVAL_MS |
(default in code) | src/lib/spend/batchWriter.ts |
Flush interval (ms) for the batched spend/cost writer. Lower values reduce write coalescing; higher values reduce DB contention. |
OMNIROUTE_SPEND_MAX_BUFFER_SIZE |
(default in code) | src/lib/spend/batchWriter.ts |
Max buffered spend entries before a forced flush. Raise on high-QPS deployments; lower when bounded memory matters more. |
OMNIROUTE_PROXY_FETCH_DEBUG |
(unset) | open-sse/utils/proxyFetch.ts |
Set to "true" to emit [ProxyFetch] debug logs on the Vercel relay path. Off by default to avoid leaking routing hints. |
OMNIROUTE_DEBUG_COMPLETION |
(unset) | bin/cli/commands/completion.mjs |
Set to any non-empty value to emit [omniroute completion] diagnostics from the CLI shell-completion cache paths (read/refresh/write). Off by default — those caches fail silently so a missing/corrupt cache never breaks tab-completion. |
BATCH_RETRY_DURATION_MS |
86400000 (24h) |
open-sse/services/batchProcessor.ts |
Maximum retry window for individual batch items (ms). Items exceeding this duration are marked failed. |
BATCH_BACKOFF_BASE_MS |
5000 |
open-sse/services/batchProcessor.ts |
Base delay (ms) for exponential backoff on batch item retries. |
BATCH_BACKOFF_MAX_MS |
3600000 (1h) |
open-sse/services/batchProcessor.ts |
Cap (ms) for exponential backoff between batch item retries. |
BATCH_MAX_CONCURRENT |
1 |
open-sse/services/batchProcessor.ts |
Maximum number of batches processed concurrently. Raise to increase throughput; keep low to avoid rate-limit storms. |
Scenarios
| Scenario | Configuration |
|---|---|
| Local development | Leave all defaults. DB lives at ~/.omniroute/omniroute.db. |
| Docker | DATA_DIR=/data + mount a volume at /data. |
| Encrypted at rest | Set STORAGE_ENCRYPTION_KEY + keep backups of the key! Losing it = losing data. |
| CI/Testing | DATA_DIR=/tmp/omniroute-test — ephemeral, no encryption needed. |
3. Network & Ports
| Variable | Default | Source File | Description |
|---|---|---|---|
PORT |
20128 |
src/lib/runtime/ports.ts |
Primary port for both Dashboard UI and API endpoints (single-port mode). |
OMNIROUTE_BASE_PATH |
(empty = root) | next.config.mjs |
URL subpath for serving OmniRoute behind a reverse proxy under a subpath (sets Next.js basePath; auth redirects are basePath-aware). E.g. /omniroute. |
API_PORT |
(unset) | src/lib/runtime/ports.ts |
When set, serves the /v1/* proxy API on this separate port. |
API_HOST |
0.0.0.0 |
src/lib/runtime/ports.ts |
Bind address for the API port. |
DASHBOARD_PORT |
(unset) | src/lib/runtime/ports.ts |
When set, serves the Dashboard UI on this separate port. |
OMNI_MAX_CONCURRENT_CONNECTIONS |
0 (disabled) |
src/sse/utils/backpressure.ts |
Caps concurrent in-flight chat connections; requests over the cap get 503 with Retry-After. Positive integer enables the guard; unset/0 disables it. |
OMNIROUTE_INSTANCE_ID |
(unset) | src/shared/resilience/peerRouting.ts |
Stable, unique ID for this gateway when chaining OmniRoute instances. Enables inbound peer-loop checks. Allowed characters: letters, digits, ., _, :, and -; maximum 64 characters. |
OMNIROUTE_PEER_URLS |
(unset) | src/shared/resilience/peerRouting.ts, open-sse/executors/base.ts |
Comma-separated OmniRoute base URLs that may receive X-OmniRoute-Peer-Trace. Only explicitly allowlisted upstream URLs receive peer metadata; all other providers are untouched. |
OMNIROUTE_PEER_MAX_HOPS |
4 |
src/shared/resilience/peerRouting.ts |
Maximum number of previously visited OmniRoute instances accepted on a chained request (1-32). Repeated instances or an exhausted budget return HTTP 508 Loop Detected. |
PROD_DASHBOARD_PORT |
20130 |
docker-compose.prod.yml |
Host-side published port for the Dashboard in Docker production mode. |
PROD_API_PORT |
20131 |
docker-compose.prod.yml |
Host-side published port for the API in Docker production mode. |
OMNIROUTE_PORT |
(unset) | src/lib/runtime/ports.ts |
Takes precedence over PORT when running inside Electron or other wrappers. |
LIVE_WS_PORT |
20129 |
src/server/ws/liveServer.ts |
Port for the real-time WebSocket live monitoring server. |
LIVE_WS_HOST |
127.0.0.1 |
src/server/ws/liveServer.ts |
Bind address for the live WebSocket server. Set to 0.0.0.0 to expose on LAN (also configure LIVE_WS_ALLOWED_ORIGINS). |
LIVE_WS_ALLOWED_ORIGINS |
(unset) | src/server/ws/liveServer.ts |
Comma-separated extra origins allowed to open a live WebSocket. Loopback dashboard origins are already permitted by default. |
LIVE_WS_ALLOWED_HOSTS |
(unset) | src/server/ws/liveServerAllowList.ts |
Comma-separated extra hostnames allowed for live WebSocket origins. Unlike LIVE_WS_ALLOWED_ORIGINS (full origin URLs), matches only the host portion — useful for LAN/Tailscale setups. |
NEXT_PUBLIC_LIVE_WS_PUBLIC_URL |
(unset) | src/hooks/useLiveDashboard.ts |
Public URL for the live dashboard WebSocket (browser-side). Set when fronting the WS server with a reverse proxy or Cloudflare Tunnel (e.g. wss://ws.my-ai.com/live-ws); the browser connects there instead of ws://hostname:20132. The pathname portion is also used as the WebSocket upgrade path (default: /live-ws). |
OMNIROUTE_ENABLE_LIVE_WS |
true |
src/server/ws/liveServer.ts and scripts/start-ws-server.mjs |
Set to 0 or false to disable the real-time WebSocket server (enabled by default, loopback-bound). CI/harness toggle that disables the standalone live WebSocket helper script. |
RELAY_IP_PER_MINUTE |
30 |
src/app/api/v1/relay/chat/completions/route.ts |
Per-(token, IP) relay rate limit, requests/minute. In-memory, per instance. 0 or negative disables the IP-dimension gate (per-token DB limit still applies). |
NODE_ENV |
production |
Next.js core | Controls logging verbosity, caching, error detail exposure, and Next.js optimizations. |
OMNIROUTE_USE_TURBOPACK |
1 (Turbopack — code default) |
package.json / Next.js 16 |
Turbopack is the default bundler for npm run dev and npm run build (2-3× faster builds, benchmarked). Set to 0 to fall back to webpack on Windows, when running into native binding / bundler-compat incompatibilities, or on RAM-constrained machines — Turbopack production builds on this Next.js version line (16.2.x) are known upstream to peak far higher in memory than webpack on large module graphs (Next 16.3's Turbopack memory-eviction fix is not yet stable); webpack fallback peaks much lower. See #6409. |
OMNIROUTE_SKIP_DB_HEALTHCHECK |
(unset) | src/lib/db/core.ts / src/lib/db/healthCheck.ts |
Set to 1 to skip the SQLite integrity health check on startup. Useful for faster boot on large databases. |
CREDENTIAL_HEALTH_CHECK_INTERVAL |
300000 |
open-sse/config/constants.ts / src/lib/credentialHealth/scheduler.ts |
Interval (ms) for the background credential health check scheduler. Minimum: 10000 (10s). |
CREDENTIAL_HEALTH_CACHE_TTL |
300000 |
open-sse/config/constants.ts / src/lib/credentialHealth/cache.ts |
TTL (ms) for cached credential health status. |
OMNIROUTE_DISABLE_CREDENTIAL_HEALTH_CHECK |
false |
src/lib/credentialHealth/scheduler.ts |
Set to 1 or true to disable background periodic testing of provider connections. |
HOST |
0.0.0.0 |
scripts/dev/run-next.mjs |
Bind address for the Next.js dev/start server. Overrides the default 0.0.0.0 when set. |
HOSTNAME |
127.0.0.1 |
scripts/dev/run-next-playwright.mjs |
Bind address used by the Playwright runner when launching Next.js. Defaults to 127.0.0.1 for hermetic tests. Do not use for omniroute serve — use OMNIROUTE_SERVER_HOST instead (POSIX shells auto-set HOSTNAME to the machine name; .env cannot override it). |
OMNIROUTE_SERVER_HOST |
0.0.0.0 |
bin/cli/commands/serve.mjs |
Bind address for omniroute serve. Avoids collision with the POSIX shell HOSTNAME variable (always set to the machine name by bash/zsh). Falls back to 0.0.0.0 when unset. (#6194) |
Port Modes
┌─────────────────────────── Single Port (default) ──────────────────────────┐
│ PORT=20128 │
│ → Dashboard: http://localhost:20128 │
│ → API: http://localhost:20128/v1/chat/completions │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────── Split Ports ─────────────────────────────────────┐
│ DASHBOARD_PORT=20128 │
│ API_PORT=20129 │
│ API_HOST=0.0.0.0 │
│ → Dashboard: http://localhost:20128 │
│ → API: http://0.0.0.0:20129/v1/chat/completions │
│ Use case: Expose API to LAN while restricting Dashboard to localhost. │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────── Docker Production ──────────────────────────────┐
│ PROD_DASHBOARD_PORT=443 PROD_API_PORT=8443 │
│ → Maps container ports to host ports in docker-compose.prod.yml. │
└─────────────────────────────────────────────────────────────────────────────┘
4. Security & Authentication
| Variable | Default | Source File | Description |
|---|---|---|---|
MACHINE_ID_SALT |
endpoint-proxy-salt |
src/lib/auth |
Salt combined with hardware identifiers for machine fingerprinting. Change per-deployment for isolation. |
OMNIROUTE_CLI_SALT |
omniroute-cli-auth-v1 |
src/lib/machineToken.ts |
HMAC salt for deriving the local CLI auth token. Changing this value rotates all CLI tokens on the machine. See docs/security/CLI_TOKEN.md. |
AUTH_COOKIE_SECURE |
false |
src/lib/auth |
Sets the Secure flag on session cookies. Must be true when running behind HTTPS. |
REQUIRE_API_KEY |
false |
API middleware | When true, all /v1/* proxy requests must include a valid API key. |
ALLOW_API_KEY_REVEAL |
false |
src/shared/constants/featureFlagDefinitions.ts |
Allows revealing full API key values in the Dashboard UI. Configurable from Dashboard Feature Flags; security risk on shared instances. |
NO_LOG_API_KEY_IDS |
(empty) | src/lib/compliance/index.ts |
Comma-separated API key IDs that bypass request logging (GDPR compliance). |
DEFAULT_RATE_LIMIT_PER_DAY |
1000 |
src/shared/utils/apiKeyPolicy.ts |
Fallback per-day request budget applied to API keys whose rate_limits column is null. Default (unset/empty/malformed) keeps the legacy 1000/day, 5000/week, 20000/month windows. Set explicitly to 0 to opt out (unlimited). Any positive integer N enables N/day, 5N/week, 20N/month. Zod-validated; invalid values log a warning and use the legacy default. |
MAX_BODY_SIZE_BYTES |
10485760 (10 MB) |
src/shared/middleware/bodySizeGuard.ts |
Maximum allowed request body size. Rejects payloads exceeding this limit. |
OMNIROUTE_CHAT_LARGE_BODY_BYTES |
262144 (256 KB) |
src/shared/middleware/chatBodyAdmission.ts |
Actual request bodies at or above this threshold require an atomic process-local heavyweight admission lease before JSON parsing. |
OMNIROUTE_CHAT_HARD_MAX_BODY_BYTES |
52428800 (50 MB) |
src/shared/middleware/chatBodyAdmission.ts |
Chat-route hard cap enforced against bytes read during bounded ingestion, including requests with missing, invalid, or dishonest Content-Length; excess receives 413. |
OMNIROUTE_CHAT_MAX_HEAVY_IN_FLIGHT |
1 |
src/shared/middleware/chatBodyAdmission.ts |
Maximum heavyweight chat requests admitted concurrently in one process. When capacity is unavailable, OmniRoute returns retryable 503 with Retry-After. |
OMNIROUTE_MAX_NONSTREAMING_RESPONSE_BYTES |
67108864 (64 MB) |
open-sse/handlers/chatCore/nonStreamingResponseBody.ts |
Hard cap for a non-streaming upstream response buffered fully into memory. Past this the upstream reader is cancelled and the request fails fast instead of growing an unbounded string until the heap is exhausted. |
CORS_ORIGIN |
(unset) | src/server/cors/origins.ts |
Legacy single-origin CORS allowlist. Prefer CORS_ALLOWED_ORIGINS for new deployments. CORS is only for cross-origin browser API clients; authenticated dashboard writes use same-origin requests plus session-bound CSRF protection instead. |
CORS_ALLOWED_ORIGINS |
(unset) | src/server/cors/origins.ts |
Comma-separated CORS allowlist. No wildcard is sent unless CORS_ALLOW_ALL=true is explicitly configured. |
CORS_ALLOW_ALL |
false |
src/server/cors/origins.ts |
Development-only escape hatch to echo any browser Origin. Do not enable on shared or production deployments. |
OUTBOUND_SSRF_GUARD_ENABLED |
true |
src/shared/network/outboundUrlGuard.ts |
Block provider calls targeting private/loopback/link-local IP ranges. Disable only in isolated test envs. |
OMNIROUTE_ALLOW_PRIVATE_PROVIDER_URLS |
false |
src/shared/network/outboundUrlGuard.ts |
Allow provider URLs pointing to private/local networks (localhost, 192.168.x.x, 10.x.x.x, etc.). REQUIRED for self-hosted providers (LM Studio, Ollama, vLLM, Llamafile, Triton, SearXNG). When false, the dashboard rejects validation of local URLs. |
OMNIROUTE_ALLOW_LOCAL_PROVIDER_URLS |
true |
src/shared/network/outboundUrlGuard.ts |
Allow adding/validating providers on local/private addresses (127.0.0.1, localhost, LAN, private ranges) — scoped to the provider validation path. Default true (local-first); set false to enforce strict public-only blocking. Cloud-metadata endpoints (169.254.169.254, metadata.google.internal) stay blocked regardless. (#5066) |
Hardening Checklist
# Production security minimum:
AUTH_COOKIE_SECURE=true # Requires HTTPS
REQUIRE_API_KEY=true # Authenticate all proxy calls
ALLOW_API_KEY_REVEAL=false # Never expose keys in UI
CORS_ALLOWED_ORIGINS=https://your.domain.com
MAX_BODY_SIZE_BYTES=5242880 # 5 MB limit
5. Input Sanitization & PII Protection
OmniRoute provides a two-layer defense: request-side injection scanning and response-side PII stripping.
Request-Side: Prompt Injection Guard
| Variable | Default | Source File | Description |
|---|---|---|---|
INPUT_SANITIZER_ENABLED |
true |
src/middleware/promptInjectionGuard.ts |
Enable scanning of incoming messages for prompt injection patterns. |
INPUT_SANITIZER_MODE |
warn |
src/middleware/promptInjectionGuard.ts |
warn = log only, block = reject request with 400, redact = strip suspicious patterns. |
INJECTION_GUARD_MODE |
(unset) | src/middleware/promptInjectionGuard.ts |
Legacy alias for INPUT_SANITIZER_MODE — same behavior. |
PII_REDACTION_ENABLED |
false |
src/middleware/promptInjectionGuard.ts |
Detect PII (emails, phones, SSNs) in incoming requests. |
CREDENTIAL_REDACTION_ENABLED |
false |
src/lib/guardrails/credentialMasker.ts |
Redact well-known API-key / secret-token patterns from request/response payloads. Opt-in; mirrors PII_REDACTION_ENABLED. |
Response-Side: PII Sanitizer
| Variable | Default | Source File | Description |
|---|---|---|---|
PII_RESPONSE_SANITIZATION |
false |
src/lib/piiSanitizer.ts |
Scan LLM responses for leaked PII before returning to client. |
PII_RESPONSE_SANITIZATION_MODE |
redact |
src/lib/piiSanitizer.ts |
redact = mask PII, warn = log only, block = drop entire response. |
VS Code Tokenized-Route Context Sanitizer
| Variable | Default | Source File | Description |
|---|---|---|---|
OMNIROUTE_VSCODE_SANITIZE_CONTEXT |
1 |
src/app/api/v1/vscode/contextSanitizer.ts |
Strips implicit active-editor context (editorContext, activeEditor, currentFile, selection, openTabs…) from /v1/vscode/[token]/* requests and redacts content of explicitly-attached sensitive files. Secure-by-default; set to 0 to disable. |
Scenarios
| Scenario | Configuration |
|---|---|
| Enterprise compliance | INPUT_SANITIZER_ENABLED=true, INPUT_SANITIZER_MODE=block, PII_REDACTION_ENABLED=true, PII_RESPONSE_SANITIZATION=true |
| Monitoring only | INPUT_SANITIZER_ENABLED=true, INPUT_SANITIZER_MODE=warn — logs but never blocks |
| Personal use | Leave all disabled — zero overhead |
6. Tool & Routing Policies
| Variable | Default | Source File | Description |
|---|---|---|---|
TOOL_POLICY_MODE |
disabled |
src/lib/toolPolicy.ts |
Controls LLM tool/function-calling access. allowlist = only listed tools, denylist = all except listed, disabled = no restrictions. |
OMNIROUTE_PAYLOAD_RULES_PATH |
./config/payloadRules.json |
open-sse/services/payloadRules.ts |
Path to payload manipulation rules JSON file (per-model/protocol upstream tweaks). |
OMNIROUTE_PAYLOAD_RULES_RELOAD_MS |
5000 |
open-sse/services/payloadRules.ts |
Reload interval (ms) for hot-reloading the payload rules file. Minimum 1000. |
OMNIROUTE_PREFER_CLAUDE_CODE_FOR_UNPREFIXED_CLAUDE_MODELS |
false |
open-sse/services/model.ts |
Opt-in: route bare claude-* model IDs from Claude Code clients through the Claude Code OAuth account instead of requiring a provider prefix. Explicit provider prefixes still win. Also configurable via a dashboard toggle on the Claude provider page. |
7. URLs & Cloud Sync
| Variable | Default | Source File | Description |
|---|---|---|---|
BASE_URL |
http://localhost:20128 |
src/lib/cloudSync.ts |
Server-side URL for internal sync jobs to call /api/sync/cloud. Keep this as a loopback/container URL even when the app is publicly proxied. |
CLOUD_URL |
(empty) | src/lib/cloudSync.ts |
Cloud relay endpoint URL (premium feature). |
CLOUD_SYNC_TIMEOUT_MS |
12000 |
src/lib/cloudSync.ts |
HTTP timeout for cloud sync requests. |
OMNIROUTE_BUILD_PROFILE |
full |
Webpack build config | Build-time profile (set to minimal to physically exclude privileged modules from bundle). |
OMNIROUTE_CLOUD_SYNC_SECRET |
(empty) | src/lib/cloudSync.ts |
Shared secret used to verify the HMAC-SHA256 signature of Cloud Sync responses. |
OMNIROUTE_CLOUD_SYNC_SECRETS |
false |
src/lib/cloudSync.ts |
Set to true to allow the Cloud Sync endpoint to overwrite local credentials. Default is false. |
OMNIROUTE_ZED_IMPORT_LEGACY_ONE_STEP |
false |
src/app/api/providers/zed/import/route.ts |
Set to true to fall back to the v3.8.5 one-step "import everything" behavior without user confirmation. |
NEXT_PUBLIC_BASE_URL |
http://localhost:20128 |
OAuth, Dashboard, sync | Public-facing URL for OAuth redirect_uri, Dashboard links, and generated public URLs. Set this to the stable public URL when OAuth callbacks or generated browser links must use a canonical reverse-proxy host. |
NEXT_PUBLIC_CLOUD_URL |
(empty) | Client-side | Client-side mirror of CLOUD_URL. |
NEXT_PUBLIC_APP_URL |
(unset) | src/shared/services/cloudSyncScheduler.ts |
Legacy fallback for NEXT_PUBLIC_BASE_URL. |
OMNIROUTE_PUBLIC_BASE_URL |
(unset) | Public-origin resolver, image URLs | Highest-priority browser-facing OmniRoute origin used for public URL generation and non-dashboard browser-origin validation (for example /v1/chatgpt-web/image/<id>). Set this when OpenWebUI or another relay reaches OmniRoute by an internal URL but the user's browser must fetch images from a LAN, tunnel, or public origin. Do not include /v1. |
OMNIROUTE_PROVIDER_MANIFEST_URL |
(unset) | open-sse/config/providerPluginManifestUrl.ts |
Absolute provider plugin manifest URL advertised to sidecar clients. When unset, OmniRoute derives /api/v1/provider-plugin-manifest from request origin or HOST/PORT. |
OMNIROUTE_PUBLIC_PROTOCOL |
http |
open-sse/config/providerPluginManifestUrl.ts |
Protocol used when deriving the provider plugin manifest URL from HOST/PORT without a request origin. Set to https behind a TLS-terminating public proxy when no explicit OMNIROUTE_PROVIDER_MANIFEST_URL is set. |
OMNIROUTE_TRUST_PROXY |
(unset) | src/server/origin/publicOrigin.ts |
Optional trust mode for forwarded public-origin headers. Unset = do not trust Forwarded / X-Forwarded-* for security decisions. true / loopback trusts forwarded host/proto only from a token-stamped loopback proxy. private / lan also trusts private-LAN proxy peers. Prefer explicit NEXT_PUBLIC_BASE_URL in production. |
OMNIROUTE_CGPT_WEB_IMAGE_TIMEOUT_MS |
180000 (3 min) |
open-sse/executors/chatgpt-web.ts |
Max wait time for an async chatgpt-web image to land via the celsius WebSocket. Increase during upstream queue-deep windows. |
OMNIROUTE_CGPT_WEB_IMAGE_CACHE_MAX_MB |
256 |
open-sse/services/chatgptImageCache.ts |
Total in-memory byte budget (MB) for the chatgpt-web image cache serving /v1/chatgpt-web/image/<id>. Lower on memory-constrained hosts; raise if image generation is heavy and clients race the 30-minute TTL. |
OMNIROUTE_CGPT_WEB_PRO_TIMEOUT_MS |
1200000 (20 min) |
open-sse/executors/chatgpt-web.ts |
Overall wait budget for a chatgpt-web GPT-5.5 Pro background-poll handoff. Pro reasoning runs complete out-of-band, so OmniRoute polls until the answer lands or this budget elapses. Raise if Pro requests time out before finishing. |
OMNIROUTE_CGPT_WEB_PRO_POLL_INTERVAL_MS |
4000 (4s) |
open-sse/executors/chatgpt-web.ts |
Interval between chatgpt-web GPT-5.5 Pro background-poll attempts. Lower for snappier completion at the cost of more upstream polling; raise to reduce request volume. |
THEOLDLLM_NAV_TIMEOUT_MS |
30000 (30s) |
open-sse/executors/theoldllm.ts |
Playwright navigation timeout (ms) for the browser-backed token capture used by the The Old LLM (theoldllm) free provider. Raise on slow networks if the relay page is slow to settle. |
KIE_CALLBACK_URL |
(unset) | open-sse/utils/kieTask.ts |
Public callback URL for asynchronous kie.ai jobs. Highest-priority override before OMNIROUTE_KIE_CALLBACK_URL and OMNIROUTE_PUBLIC_URL. |
OMNIROUTE_KIE_CALLBACK_URL |
(unset) | open-sse/utils/kieTask.ts |
Alternate spelling of KIE_CALLBACK_URL. Falls back when the primary variable is unset. |
OMNIROUTE_PUBLIC_URL |
(unset) | open-sse/utils/kieTask.ts |
Public origin used to compose async callback URLs. Lowest-priority fallback for kie.ai callbacks; also used as a generic public URL for other relays. |
OMNIROUTE_CROF_USAGE_URL |
https://crof.ai/usage_api/ |
open-sse/services/usage.ts |
CrofAI quota lookup endpoint used by the Usage page. Override for relays / test fixtures. |
OMNIROUTE_OPENCODE_QUOTA_URL |
https://opencode.ai/zen/go/v1/quota |
open-sse/services/opencodeQuotaFetcher.ts |
OpenCode (zen/go) quota lookup endpoint used by the Usage page. Override for relays / test fixtures. |
OMNIROUTE_OPENCODE_GO_QUOTA_URL |
(unset) | open-sse/services/opencodeOllamaUsage.ts |
OpenCode Go quota lookup endpoint used by the Usage page. OpenCode Go has no public quota API, so this has no default and the network call is skipped unless the operator opts in to a self-hosted/mirrored endpoint. |
OMNIROUTE_OPENCODE_GO_DASHBOARD_URL |
https://opencode.ai/workspace |
open-sse/services/usage.ts |
OpenCode Go dashboard base URL used for quota scraping when a workspace ID and auth cookie are configured. Override for relays / test fixtures. |
OPENCODE_GO_WORKSPACE_ID |
(unset) | open-sse/services/usage.ts |
OpenCode Go workspace ID used for dashboard quota scraping. Prefer the per-connection Dashboard field when multiple accounts are configured. |
OMNIROUTE_OPENCODE_GO_WORKSPACE_ID |
(unset) | open-sse/services/usage.ts |
Alternate OpenCode Go workspace ID env var used before the shorter alias. Prefer the per-connection Dashboard field when multiple accounts are configured. |
OPENCODE_GO_AUTH_COOKIE |
(unset) | open-sse/services/usage.ts |
OpenCode Go auth cookie used for dashboard quota scraping. Sensitive; prefer the per-connection Dashboard field when multiple accounts are configured. |
OPENCODE_SYNTHESIZE_CLI_HEADERS |
false |
open-sse/executors/opencode.ts |
Opt-in: synthesize OpenCode CLI identity headers (User-Agent, x-opencode-client/project, request/session UUIDs) on opencode-go/zen upstream requests the client didn't send, so Cloudflare on VPS egress accepts them (#6210/#5997). Off by default (forward-only is safer). |
OPENCODE_USER_AGENT |
opencode-cli/1.0.0 |
open-sse/executors/opencode.ts |
Default User-Agent used when OPENCODE_SYNTHESIZE_CLI_HEADERS is on and no per-provider <PROVIDER>_USER_AGENT override is set. Only applied to opencode executors. |
OPENCODE_CLIENT |
cli |
open-sse/executors/opencode.ts |
Value for the synthesized x-opencode-client header when OPENCODE_SYNTHESIZE_CLI_HEADERS is on. |
OPENCODE_PROJECT |
default |
open-sse/executors/opencode.ts |
Value for the synthesized x-opencode-project header when OPENCODE_SYNTHESIZE_CLI_HEADERS is on. |
OMNIROUTE_OPENCODE_GO_AUTH_COOKIE |
(unset) | open-sse/services/usage.ts |
Alternate OpenCode Go auth cookie env var used before the shorter alias. Sensitive; prefer the per-connection Dashboard field when multiple accounts are configured. |
OMNIROUTE_OLLAMA_CLOUD_USAGE_URL |
https://ollama.com/settings |
open-sse/services/usage.ts |
Ollama Cloud settings URL used for quota scraping. Override for relays / test fixtures. |
OLLAMA_USAGE_COOKIE |
(unset) | open-sse/services/usage.ts |
Ollama Cloud __Secure-session cookie used for settings-page quota scraping. Sensitive; prefer the per-connection Dashboard field when multiple accounts are configured. |
OLLAMA_CLOUD_USAGE_COOKIE |
(unset) | open-sse/services/usage.ts |
Alternate Ollama Cloud __Secure-session cookie env var. Sensitive; prefer the per-connection Dashboard field when multiple accounts are configured. |
OMNIROUTE_OLLAMA_USAGE_COOKIE |
(unset) | open-sse/services/usage.ts |
Alternate Ollama Cloud __Secure-session cookie env var used before the shorter aliases. Sensitive; prefer the per-connection Dashboard field when multiple accounts are configured. |
OMNIROUTE_CODEWHISPERER_BASE_URL |
https://codewhisperer.us-east-1.amazonaws.com |
open-sse/services/usage.ts |
CodeWhisperer (AWS Kiro) usage limits endpoint. Override for relays / test fixtures. |
Important
When deploying behind a reverse proxy (nginx, Caddy), set
NEXT_PUBLIC_BASE_URLto your stable public URL (e.g.,https://omniroute.example.com) when OAuth callbacks or generated public links must use that hostname. Without this, OAuth callbacks can fail because the redirect_uri won't match and generated public links can point at the internal container origin.Keep
BASE_URLas an internal loopback/container URL for server-to-server jobs. Do not use a browserOriginor public hostname for credential-bearing internal self-fetches.Authenticated dashboard writes do not require a static public base URL: the dashboard sends same-origin unsafe requests with a session-bound CSRF token. OmniRoute still centralizes public-origin validation for non-dashboard browser integrations: explicit public URL env vars are trusted first; raw
Forwarded/X-Forwarded-*headers are ignored unlessOMNIROUTE_TRUST_PROXYis enabled and the immediate proxy peer is token-stamped as trusted. Do not use CORS settings to fix same-origin dashboard requests; CORS is only for cross-origin browser clients.
8. Outbound Proxy
Route upstream LLM provider calls through an HTTP or SOCKS5 proxy for egress control, geo-routing, or IP masking.
| Variable | Default | Source File | Description |
|---|---|---|---|
ENABLE_SOCKS5_PROXY |
true |
open-sse/executors |
Enable SOCKS5 proxy agent for upstream calls. Opt-out with false. |
NEXT_PUBLIC_ENABLE_SOCKS5_PROXY |
true |
Client-side | Client-side awareness of SOCKS5 availability. |
HTTP_PROXY |
(unset) | Node.js standard | HTTP proxy for upstream calls. |
HTTPS_PROXY |
(unset) | Node.js standard | HTTPS proxy for upstream calls. |
ALL_PROXY |
(unset) | Node.js standard | Universal proxy (supports socks5://). |
NO_PROXY |
(unset) | Node.js standard | Comma-separated hostnames/IPs to bypass the proxy. |
OMNIROUTE_PROXY_DISPATCHER_CONNECTIONS |
32 |
open-sse/utils/proxyDispatcher.ts |
Max concurrent sockets per cached HTTP/SOCKS proxy dispatcher. Long-lived SSE streams such as Codex /v1/responses need more than one connection when several requests share the same account-level proxy. Values above 256 are capped. |
SOCKS_HANDSHAKE_TIMEOUT_MS |
10000 |
open-sse/utils/socksConnectorWithFamily.ts |
SOCKS5 handshake (connect) timeout in ms. Raise it when a single residential gateway host is hit by high concurrency (e.g. 100 simultaneous requests) — the real handshake can exceed 10s under a saturated pool even though the proxy is reachable, which otherwise surfaces as a false [Proxy Fast-Fail] Proxy unreachable. Capped at 120000. |
PROXY_FAIL_OPEN |
false |
src/sse/handlers/chatHelpers.ts |
When false (default), a request whose assigned proxy fails to resolve is refused (fail-closed) rather than falling back to a direct connection — prevents real-IP leaks. Set true to restore the legacy DIRECT fallback. |
ENABLE_TLS_FINGERPRINT |
false |
open-sse/executors |
Spoof TLS fingerprint using wreq-js (mimics Chrome 124). Counters JA3/JA4 blocking. |
OMNIROUTE_TURNSTILE_IGNORE_TLS_ERRORS |
false |
open-sse/services/claudeTurnstileSolver.ts |
Allow the Claude Turnstile Playwright browser context to ignore HTTPS certificate errors. |
Scenarios
| Scenario | Configuration |
|---|---|
| SOCKS5 through SSH tunnel | ALL_PROXY=socks5://127.0.0.1:7890, ENABLE_SOCKS5_PROXY=true |
| Corporate HTTP proxy | HTTP_PROXY=http://proxy.corp.com:3128, HTTPS_PROXY=http://proxy.corp.com:3128, NO_PROXY=localhost,internal.corp.com |
| Anti-fingerprint | ENABLE_TLS_FINGERPRINT=true — requires wreq-js (included) |
| Egress-controlled / no direct access | Leave PROXY_FAIL_OPEN=false (default). Requests fail hard when the proxy is unavailable instead of leaking via direct. |
| Legacy / dev — allow direct fallback | PROXY_FAIL_OPEN=true. Restores pre-hardening behaviour: direct connection used when proxy resolution fails. |
Note (NVIDIA validation bypass — #3226): NVIDIA's API-key validation endpoint stalls when routed through the global proxy/TLS-patched fetch (undici dispatcher → 504).
src/lib/providers/validation.ts::directHttpsRequest()intentionally bypasses the proxy patch for that one validation call usingsafeOutboundFetch({ bypassProxyPatch: true }). This is a documented, scoped exception — it does not affect chat/usage egress. The bypass is scope-pinned bytests/unit/proxy-bypass-scope-guard-3226.test.ts.
9. CLI Tool Integration
Controls how OmniRoute discovers and launches CLI sidecars (Claude Code, Codex, etc.).
| Variable | Default | Source File | Description |
|---|---|---|---|
CLI_MODE |
auto |
src/shared/services/cliRuntime.ts |
auto = search system PATH; manual = use explicit paths only. |
CLI_EXTRA_PATHS |
(unset) | src/shared/services/cliRuntime.ts |
Additional PATH entries for CLI binary discovery (colon-separated). |
CLI_CONFIG_HOME |
(unset) | src/shared/services/cliRuntime.ts |
Override home directory for reading CLI configs (~/.claude, ~/.codex). |
CLI_ALLOW_CONFIG_WRITES |
false |
src/shared/services/cliRuntime.ts |
Allow OmniRoute to write CLI config files (token refresh, session data). |
CLI_CLAUDE_BIN |
claude |
src/shared/services/cliRuntime.ts |
Custom path to Claude CLI binary. |
CLI_CODEX_BIN |
codex |
src/shared/services/cliRuntime.ts |
Custom path to Codex CLI binary. |
CLI_DROID_BIN |
droid |
src/shared/services/cliRuntime.ts |
Custom path to Droid CLI binary. |
CLI_OPENCLAW_BIN |
openclaw |
src/shared/services/cliRuntime.ts |
Custom path to OpenClaw CLI binary. |
CLI_CURSOR_BIN |
agent |
src/shared/services/cliRuntime.ts |
Custom path to Cursor agent binary. |
CLI_CLINE_BIN |
cline |
src/shared/services/cliRuntime.ts |
Custom path to Cline CLI binary. |
CLI_CONTINUE_BIN |
cn |
src/shared/services/cliRuntime.ts |
Custom path to Continue CLI binary. |
CLI_QODER_BIN |
qoder |
src/shared/services/cliRuntime.ts |
Custom path to Qoder CLI binary. |
CLI_QWEN_BIN |
qwen |
src/shared/services/cliRuntime.ts |
Custom path to the Qwen Code CLI binary. |
CLI_DEVIN_BIN |
devin |
open-sse/executors/devin-cli.ts |
Custom path to the Devin CLI binary (v3.8.0). Used by the Windsurf/Devin executor. |
AUGGIE_BIN |
auggie |
open-sse/executors/auggie.ts |
Absolute-path override for the Augment (Auggie) CLI binary used by the local auggie provider. Falls back to CLI_AUGGIE_BIN, then a PATH lookup. |
CLI_AUGGIE_BIN |
auggie |
open-sse/executors/auggie.ts |
Alias override for the Augment (Auggie) CLI binary path (checked after AUGGIE_BIN). |
HERMES_HOME |
~/.hermes |
src/lib/cli-helper/config-generator/hermesHome.ts |
Hermes Agent home directory where OmniRoute reads/writes the Hermes CLI config. Matches the env var the Hermes PowerShell installer sets on Windows (%LOCALAPPDATA%\hermes). |
CLI Profile Auto-Sync
These feature flags are opt-in and default off. They can also be toggled from the CLI Code dashboard.
| Variable | Default | Source File | Description |
|---|---|---|---|
OMNIROUTE_AUTO_SYNC_CODEX_PROFILES |
false |
src/shared/constants/featureFlagDefinitions.ts |
After a provider model sync, automatically rewrites ~/.codex/*.config.toml profile files from the live catalog. Requires CLI_ALLOW_CONFIG_WRITES; never changes the active/default Codex config, auth, Codex-lb settings, or provider choice. |
OMNIROUTE_AUTO_SYNC_CLAUDE_PROFILES |
false |
src/shared/constants/featureFlagDefinitions.ts |
After a provider model sync, automatically rewrites ~/.claude/profiles/<name>/settings.json Claude Code profile files from the live catalog. Requires CLI_ALLOW_CONFIG_WRITES; never changes the active/default Claude config, auth, or provider choice. |
Docker Example
# Mount host binaries into the container and tell OmniRoute where they are:
CLI_EXTRA_PATHS=/host-cli/bin
CLI_CONFIG_HOME=/root
CLI_ALLOW_CONFIG_WRITES=true
CLI_CLAUDE_BIN=/host-cli/bin/claude
CLI Binary (omniroute) helpers
These variables tune the omniroute CLI binary's own behavior (not the sidecar
detection above).
| Variable | Default | Source File | Description |
|---|---|---|---|
OMNIROUTE_LANG |
(system) | bin/cli/i18n.mjs |
Force CLI output language. BCP-47 locale (e.g. en, pt-BR). Overrides system locale env vars (LC_ALL, LC_MESSAGES). |
OMNIROUTE_SHOW_LOG |
(unset) | bin/cli/runtime/processSupervisor.mjs |
Set to 1 to forward server stdout/stderr to the terminal in supervised mode. Equivalent to --log flag on omniroute serve. |
OMNIROUTE_CLI_TOKEN |
(unset) | bin/cli/api.mjs |
Machine-auth token injected as x-omniroute-cli-token header. Auto-generated in task 8.12. |
OMNIROUTE_HTTP_TIMEOUT_MS |
30000 |
bin/cli/api.mjs |
Per-attempt HTTP timeout (ms) for CLI → server requests. |
OMNIROUTE_VERBOSE |
0 |
bin/cli/api.mjs |
Set to 1 to print retry/backoff diagnostics to stderr during CLI commands. |
OMNIROUTE_PLUGIN_PATH |
(unset) | bin/cli/plugins.mjs |
Custom directory for CLI plugin discovery (omniroute-cmd-* packages). Defaults to ~/.omniroute/plugins/ when unset. |
OMNIROUTE_PLUGINS_ALLOW_EXEC |
0 |
src/lib/plugins/pluginWorker.ts |
Set to 1 to allow plugins to request the exec permission (spawn child processes from the worker sandbox). Local operator only. |
10. Internal Agent & MCP Integrations
| Variable | Default | Source File | Description |
|---|---|---|---|
OMNIROUTE_BASE_URL |
auto-detect | open-sse/mcp-server/server.ts |
Explicit URL for MCP/A2A tools to reach OmniRoute. Overrides localhost auto-detection. |
OMNIROUTE_API_KEY |
(unset) | MCP/A2A modules | API key for internal MCP tool and A2A skill calls. |
OMNIROUTE_API_KEY_ID |
(unset) | open-sse/mcp-server/audit.ts |
Key ID for MCP audit log attribution. |
ROUTER_API_KEY |
(unset) | Legacy | Legacy alias for OMNIROUTE_API_KEY. |
OMNIROUTE_ISSUE_AGENT_ENABLED |
false |
src/app/api/issue-agent/runs/route.ts |
Enables the offline/local Issue Agent recorded-triage endpoint. Leave disabled unless explicitly running local recorded-triage workflows. |
OMNIROUTE_ISSUE_AGENT_TIMEOUT_MS |
(unset) | src/lib/issueAgent/execution.ts |
Timeout (ms) for a single Issue Agent recorded-triage run. Clamped to an internal maximum; falls back to the built-in default when unset or invalid. |
OMNIROUTE_CONTEXT |
(active context) | bin/cli/program.mjs, bin/cli/api.mjs |
CLI remote-mode context/profile for omniroute commands; overrides the active context in the local contexts store. Equivalent to --context <name>. |
OMNIROUTE_MCP_ENFORCE_SCOPES |
true |
open-sse/mcp-server/server.ts |
Enforce scope-based access control on MCP tool calls. |
OMNIROUTE_MCP_SCOPES |
(all) | open-sse/mcp-server/server.ts |
Comma-separated scopes: admin, combos, health, models, routing, budget, metrics, pricing, memory, skills. |
OMNIROUTE_MCP_COMPRESS_DESCRIPTIONS |
false |
open-sse/mcp-server/descriptionCompressor.ts |
Compress MCP tool descriptions before serializing the manifest. Enable values: 1, true, on. |
OMNIROUTE_MCP_DESCRIPTION_COMPRESSION |
rtk |
open-sse/mcp-server/descriptionCompressor.ts |
Compression algorithm/profile. Disable values: 0, false, off. |
MODEL_SYNC_INTERVAL_HOURS |
24 |
src/shared/services/modelSyncScheduler.ts |
Model catalog sync interval in hours. |
PROVIDER_LIMITS_SYNC_INTERVAL_MINUTES |
70 |
src/server-init.ts |
Provider rate-limit and quota polling interval. |
PROVIDER_LIMITS_SYNC_SPACING_MS |
1500 |
src/lib/usage/providerLimits.ts |
Gap (ms) between consecutive OAuth quota fetches in a bulk sync; OAuth connections are fetched one at a time to avoid bursting an upstream. 0 opts out (concurrent). |
OMNIROUTE_QUOTA_FETCH_MIN_INTERVAL_MS |
250 |
open-sse/services/quotaFetchThrottle.ts |
Min interval (ms) between consecutive upstream quota fetches on the per-request preflight/monitor path; spaces concurrent network calls so many accounts on one IP don't burst the upstream. Wired into the Codex (/wham/usage), DeepSeek, Bailian (both fetch sites), OpenCode, and Crof quota fetchers (#6009, #6911). The generic usage.ts::getUsageForProvider dispatch path (github/glm/minimax/nanogpt/xai/etc.) is not yet covered — tracked separately. Cache hits unaffected. 0 disables; clamped 0..5000. |
PROVIDER_LIMITS_POST_USAGE_REFRESH_DELAY_MS |
5000 |
src/lib/usage/providerLimits.ts |
Delay (ms) before refreshing provider limits after a real usage event, giving the upstream quota API time to register consumption. |
OMNIROUTE_DISABLE_BACKGROUND_SERVICES |
false |
src/instrumentation-node.ts |
Disable all background services (sync, pricing, model refresh). Useful for CI/test. |
OMNIROUTE_ENABLE_RUNTIME_BACKGROUND_TASKS |
(unset) | src/lib/config/runtimeSettings.ts |
Force background tasks on under automated test detection. Set 1 to override the test heuristic. |
OMNIROUTE_BUDGET_RESET_JOB_INTERVAL_MS |
600000 |
src/lib/jobs/budgetResetJob.ts |
Budget reset check cadence (ms). Floor 10000. |
OMNIROUTE_CONNECTION_RECOVERY_INTERVAL_MS |
60000 |
src/lib/quota/connectionRecovery.ts |
Proactive connection-cooldown recovery cadence (ms): re-validates connections whose transient rate_limited_until has elapsed, off the request hot path. Floor 5000. |
OMNIROUTE_DISABLE_CONNECTION_RECOVERY |
false |
src/lib/quota/connectionRecovery.ts |
Disable the proactive connection-cooldown recovery scheduler (lazy recovery in getProviderCredentials still applies). |
OMNIROUTE_REASONING_CACHE_CLEANUP_INTERVAL_MS |
1800000 |
src/lib/jobs/reasoningCacheCleanupJob.ts |
Reasoning cache cleanup cadence (ms). Floor 60000. |
OMNIROUTE_CONFIG_HOT_RELOAD_MS |
5000 |
src/lib/config/hotReload.ts |
Polling interval (ms) for config hot-reload. Lower than 1000 is rejected. |
OMNIROUTE_DISABLE_REDIS_AUTH_CACHE |
(enabled) | src/lib/db/apiKeys.ts |
Set 1 to bypass the Redis-backed API-key auth cache (forces DB reads). |
OMNIROUTE_RTK_TRUST_PROJECT_FILTERS |
0 |
open-sse/services/compression/engines/rtk/filterLoader.ts |
Trust user-managed RTK project filter rules without strict signature checks. |
COMPRESSION_PIPELINE_BREAKER_ENABLED |
false |
open-sse/services/compression/pipelineEngineBreaker.ts |
T02 stacked-pipeline per-engine circuit-breaker master switch. Opt-in (default off) — when on, an engine that throws repeatedly across requests is skipped (fail-open) for a cooldown; off = byte-identical legacy behavior. |
COMPRESSION_PIPELINE_BREAKER_THRESHOLD |
3 |
open-sse/services/compression/pipelineEngineBreaker.ts |
Consecutive cross-request failures before an engine's breaker opens. |
COMPRESSION_PIPELINE_BREAKER_COOLDOWN_MS |
30000 |
open-sse/services/compression/pipelineEngineBreaker.ts |
Milliseconds an opened engine stays skipped before a half-open probe. |
COMPRESSION_CCR_RETRIEVAL_RAMP_FACTOR |
2 |
open-sse/services/compression/engines/ccr/index.ts |
T08/H8 CCR retrieval-feedback ramp: each prior retrieval of a stored block raises its effective minChars linearly (frequently-retrieved content compresses less; >=3 retrievals = never compressed). 1 disables the ramp (binary skip at the threshold only). |
COMPRESSION_PREFIX_FREEZE_ENABLED |
false |
open-sse/services/compression/prefixFreeze.ts |
T08/H5 usage-observed prefix freeze master switch. Opt-in (default off) — when on, a system prompt observed >= the threshold is treated as a stable cacheable prefix and preserved from compression even for providers the static cache heuristic misses (freeze only preserves, never mutates). |
COMPRESSION_PREFIX_FREEZE_THRESHOLD |
3 |
open-sse/services/compression/prefixFreeze.ts |
Observations of a system prompt before it is treated as a frozen stable prefix. |
OMNIROUTE_BOOTSTRAPPED |
false |
src/app/(dashboard)/dashboard/page.tsx |
Set true by bootstrap script after initial setup. Controls setup wizard visibility. |
OMNIROUTE_ALLOW_BODY_PROJECT_OVERRIDE |
0 |
open-sse/executors/antigravity.ts |
Escape hatch: allow request body to override the Antigravity project field. |
ANTIGRAVITY_CREDITS |
(unset) | open-sse/services/antigravityCredits.ts |
Override Antigravity's advertised remaining credits (testing / forced values). |
AGY_TOKEN_FILE |
~/.gemini/antigravity-cli/antigravity-oauth-token |
src/app/api/providers/agy-auth/apply-local/route.ts |
Override the Antigravity CLI (agy) token-file path for the auto-detect local login import. |
OAuth CLI Bridge (Internal)
| Variable | Default | Source File | Description |
|---|---|---|---|
OMNIROUTE_SERVER |
auto-detect | src/lib/oauth/config/index.ts |
Server URL for CLI↔OmniRoute auth bridge. |
OMNIROUTE_TOKEN |
(unset) | src/lib/oauth/config/index.ts |
Auth token for CLI bridge. |
OMNIROUTE_USER_ID |
cli |
src/lib/oauth/config/index.ts |
User ID for CLI bridge sessions. |
SERVER_URL |
(unset) | src/lib/oauth/config/index.ts |
Legacy alias for OMNIROUTE_SERVER. |
CLI_TOKEN |
(unset) | src/lib/oauth/config/index.ts |
Legacy alias for OMNIROUTE_TOKEN. |
CLI_USER_ID |
(unset) | src/lib/oauth/config/index.ts |
Legacy alias for OMNIROUTE_USER_ID. |
11. OAuth Provider Credentials
Built-in credentials for localhost development. For remote deployments, register your own at each provider's developer console.
| Variable | Provider | Notes |
|---|---|---|
CLAUDE_OAUTH_CLIENT_ID |
Claude Code (Anthropic) | Public client — no secret needed. |
CLAUDE_CODE_REDIRECT_URI |
Claude Code | Override redirect URI. Default: https://platform.claude.com/oauth/code/callback |
CODEX_OAUTH_CLIENT_ID |
Codex / OpenAI | Public client. |
GEMINI_OAUTH_CLIENT_ID |
Gemini (Google) | Requires matching _SECRET. |
GEMINI_OAUTH_CLIENT_SECRET |
Gemini (Google) | — |
KIMI_CODING_OAUTH_CLIENT_ID |
Kimi Coding (Moonshot) | Public client. |
ANTIGRAVITY_OAUTH_CLIENT_ID |
Antigravity (Google) | Requires matching _SECRET. |
ANTIGRAVITY_OAUTH_CLIENT_SECRET |
Antigravity (Google) | — |
GITHUB_OAUTH_CLIENT_ID |
GitHub Copilot | Public client. |
GHE_COPILOT_OAUTH_CLIENT_ID |
GHE Copilot | Optional override for GitHub Enterprise Copilot's OAuth client id. Falls back to GITHUB_OAUTH_CLIENT_ID's public default when unset. |
WINDSURF_FIREBASE_API_KEY |
Windsurf / Devin (v3.8) | Public Firebase Web API key used by Windsurf's Secure Token Service to refresh short-lived browser-flow tokens. Client-side credential (not a secret). Long-lived import tokens skip this entirely. Source: extracted from Devin CLI binary. |
WINDSURF_API_KEY |
Windsurf / Devin (v3.8) | API key fallback used by open-sse/executors/devin-cli.ts when no per-connection credential is available. Optional. |
CLI_DEVIN_BIN |
Devin CLI (v3.8) | Custom path to the Devin CLI binary (devin). Resolved by open-sse/executors/devin-cli.ts. |
GITLAB_DUO_OAUTH_CLIENT_ID |
GitLab Duo (v3.8) | OAuth client ID for GitLab Duo. Register an app at https://gitlab.com/-/profile/applications with redirect URI <NEXT_PUBLIC_BASE_URL>/callback and scopes api, read_user, openid, profile, email. Falls back to GITLAB_OAUTH_CLIENT_ID. |
GITLAB_DUO_OAUTH_CLIENT_SECRET |
GitLab Duo (v3.8) | OAuth client secret for GitLab Duo. Optional — PKCE flow does not require a secret. Falls back to GITLAB_OAUTH_CLIENT_SECRET. |
GITLAB_DUO_BASE_URL |
GitLab Duo (v3.8) | Override GitLab base URL (self-hosted GitLab). Defaults to https://gitlab.com. Falls back to GITLAB_BASE_URL. |
GITLAB_BASE_URL |
GitLab Duo (v3.8) | Legacy fallback for GITLAB_DUO_BASE_URL. Used when the _DUO_ variant is unset. |
GITLAB_OAUTH_CLIENT_ID |
GitLab Duo (v3.8) | Legacy fallback for GITLAB_DUO_OAUTH_CLIENT_ID consumed by src/lib/oauth/constants/oauth.ts. |
GITLAB_OAUTH_CLIENT_SECRET |
GitLab Duo (v3.8) | Legacy fallback for GITLAB_DUO_OAUTH_CLIENT_SECRET consumed by src/lib/oauth/constants/oauth.ts. |
QODER_OAUTH_CLIENT_SECRET |
Qoder | — |
QODER_OAUTH_AUTHORIZE_URL |
Qoder | Set to enable Qoder OAuth. |
QODER_OAUTH_TOKEN_URL |
Qoder | — |
QODER_OAUTH_USERINFO_URL |
Qoder | — |
QODER_OAUTH_CLIENT_ID |
Qoder | — |
QODER_PERSONAL_ACCESS_TOKEN |
Qoder | Direct API key fallback (bypasses OAuth). |
QODER_CLI_WORKSPACE |
Qoder | Workspace ID for Qoder CLI. |
OMNIROUTE_QODER_WORKSPACE |
Qoder | Alias for QODER_CLI_WORKSPACE. |
QODER_CLI_CONFIG_DIR |
Qoder | Override the Qoder CLI config dir (isolated PAT session, avoids clobbering a browser login). |
BLACKBOX_WEB_VALIDATED_TOKEN |
Blackbox Web | Frontend tk token to send as validated on /api/chat. Required when Blackbox enforces token matching; otherwise OmniRoute falls back to a random UUID. See issue #2252. |
VISION_BRIDGE_BASE_URL |
Vision Bridge guardrail | OpenAI-compatible base URL for non-Anthropic vision-bridge calls. Defaults to the legacy OpenAI URL env or api.openai.com. Point at OmniRoute's /v1 self-loop or any OpenAI-compat endpoint (Gemini OpenAI-compat, OpenRouter). Issue #2232. |
VISION_BRIDGE_API_KEY |
Vision Bridge guardrail | API key for the URL above. Overrides per-provider OpenAI / Google env vars for non-Anthropic vision-bridge calls. Anthropic models keep their dedicated Anthropic key path. Issue #2232. |
Warning
- Go to Google Cloud Console → Credentials
- Create an OAuth 2.0 Client ID (type: "Web application")
- Add your server URL as Authorized redirect URI
- Replace the credential values in
.env.
12. Provider User-Agent Overrides
Override the User-Agent header sent to each upstream provider. This is dynamically resolved at runtime by the executor base class:
process.env[`${PROVIDER_ID}_USER_AGENT`]
Source:
open-sse/executors/base.ts→buildHeaders()
| Variable | Default Value | When to Update | |
|---|---|---|---|
CLAUDE_USER_AGENT |
claude-cli/2.1.207 (external, cli) |
When Anthropic releases a new CLI version | |
CLAUDE_DISABLE_TOOL_NAME_CLOAK |
false |
executors/base.ts + executors/cliproxyapi.ts |
Set to 1/true to forward third-party harness tool names verbatim to Anthropic on both Anthropic-bound paths (native OAuth and CLIProxyAPI). By default the executor deterministically aliases non-Claude-Code tool names (Claude Code canonical mapping where one exists, otherwise PascalCase) and reverses them on the response via _toolNameMap, so harnesses with snake_case tools are not refused as fingerprinted third-party clients. Debugging only. |
CODEX_USER_AGENT |
codex-cli/0.142.0 (Windows 10.0.26200; x64) |
When OpenAI updates the Codex CLI | |
CODEX_CLIENT_VERSION |
0.131.0 |
Override Codex client version independently of full UA string | |
GITHUB_USER_AGENT |
GitHubCopilotChat/0.54.0 |
When GitHub Copilot Chat updates | |
ANTIGRAVITY_USER_AGENT |
antigravity/2.0.1 darwin/arm64 |
When Antigravity IDE updates | |
KIRO_USER_AGENT |
AWS-SDK-JS/3.0.0 kiro-ide/1.0.0 |
When Kiro IDE updates | |
KIRO_OAUTH_CLIENT_ID |
kiro-cli |
Override the Kiro social device-code clientId (public id) |
|
KIRO_VERIFY_FULL_CRC |
false |
Opt-in: full per-frame message CRC validation on the Kiro event stream (debug corrupted streams) | |
QODER_USER_AGENT |
Qoder-Cli |
When Qoder CLI updates | |
CURSOR_USER_AGENT |
Cursor/3.3 |
When Cursor updates |
Tip
You can add User-Agent overrides for any provider using the pattern
{PROVIDER_ID}_USER_AGENT. The executor dynamically constructs the env var name.
13. CLI Fingerprint Compatibility
When enabled, OmniRoute reorders HTTP headers and JSON body fields to match the exact signature of official CLI tools. This reduces the risk of account flagging while preserving your proxy IP.
Source: open-sse/config/cliFingerprints.ts, open-sse/executors/base.ts
Per-Provider
| Variable | Activation | Effect |
|---|---|---|
CLI_COMPAT_CODEX |
=1 |
Mimics Codex CLI request signature |
CLI_COMPAT_CLAUDE |
=1 |
Mimics Claude Code request signature |
CLI_COMPAT_GITHUB |
=1 |
Mimics GitHub Copilot request signature |
CLI_COMPAT_ANTIGRAVITY |
=1 |
Mimics Antigravity request signature |
CLI_COMPAT_CURSOR |
=1 |
Mimics Cursor request signature |
CLI_COMPAT_KIMI_CODING |
=1 |
Mimics Kimi Coding request signature |
CLI_COMPAT_KILOCODE |
=1 |
Mimics Kilo Code request signature |
CLI_COMPAT_CLINE |
=1 |
Mimics Cline request signature |
Global
| Variable | Activation | Effect |
|---|---|---|
CLI_COMPAT_ALL |
=1 |
Enable fingerprint compatibility for all providers at once. |
Kimi Coding CLI identity overrides
| Variable | Default | Source File | Description |
|---|---|---|---|
KIMI_CLI_VERSION |
1.36.0 |
src/lib/oauth/providers/kimi-coding.ts |
Override the Kimi CLI version sent during OAuth/API calls. |
KIMI_CODING_DEVICE_ID |
(captured default) | src/lib/oauth/providers/kimi-coding.ts |
Override the captured Kimi device ID used in client headers. |
Note
This feature works alongside the User-Agent overrides (§12). The fingerprint system handles header ordering and body field ordering, while User-Agent overrides handle the specific UA string. Both can be enabled independently.
14. API Key Providers
API keys for providers that use direct authentication. Preferred setup: Dashboard → Providers → Add API Key.
Setting via environment variables is an alternative for Docker or headless deployments.
Recognized pattern: {PROVIDER_ID}_API_KEY
| Variable | Provider |
|---|---|
DEEPSEEK_API_KEY |
DeepSeek |
NVIDIA_API_KEY |
NVIDIA NIM |
Note
Static
${PROVIDER}_API_KEYentries for Groq, xAI, Mistral, Perplexity, Together AI, Fireworks, Cerebras, Cohere, Nebius, and Qianfan were removed in v3.8.0 because the runtime no longer reads them — those providers rely exclusively on Dashboard /data/provider-credentials.json/ the encrypted DB. See the Audit: Removed / Dead Variables section at the bottom of this document for the migration path.
Tip
Keys set via the Dashboard are stored encrypted in SQLite and take precedence over environment variables.
15. Timeout Settings
All values are in milliseconds. Centralized resolution in src/shared/utils/runtimeTimeouts.ts.
Timeout Hierarchy
REQUEST_TIMEOUT_MS (global override)
├─→ FETCH_TIMEOUT_MS (upstream provider calls, default: 600000)
│ ├─→ FETCH_HEADERS_TIMEOUT_MS (inherits from FETCH_TIMEOUT_MS)
│ ├─→ FETCH_BODY_TIMEOUT_MS (inherits from FETCH_TIMEOUT_MS)
│ ├─→ TLS_CLIENT_TIMEOUT_MS (inherits from FETCH_TIMEOUT_MS)
│ ├── FETCH_CONNECT_TIMEOUT_MS (independent, default: 30000)
│ └── FETCH_KEEPALIVE_TIMEOUT_MS (independent, default: 4000)
├─→ STREAM_IDLE_TIMEOUT_MS (inherits from REQUEST_TIMEOUT_MS, default: 600000)
├─→ STREAM_READINESS_TIMEOUT_MS (inherits from REQUEST_TIMEOUT_MS, default: 80000)
├─→ STREAM_READINESS_MAX_TIMEOUT_MS (caps adaptive readiness extensions, default: 180000)
└─→ API_BRIDGE_PROXY_TIMEOUT_MS (inherits from REQUEST_TIMEOUT_MS, default: 30000)
├─→ API_BRIDGE_SERVER_REQUEST_TIMEOUT_MS (derived, default: 300000)
├── API_BRIDGE_SERVER_HEADERS_TIMEOUT_MS (default: 60000)
├── API_BRIDGE_SERVER_KEEPALIVE_TIMEOUT_MS (default: 5000)
└── API_BRIDGE_SERVER_SOCKET_TIMEOUT_MS (default: 0 = disabled)
| Variable | Default | Description |
|---|---|---|
REQUEST_TIMEOUT_MS |
(unset) | Global shortcut — overrides both FETCH_TIMEOUT_MS and STREAM_IDLE_TIMEOUT_MS defaults. |
FETCH_TIMEOUT_MS |
600000 |
Total HTTP request timeout for upstream provider calls. |
STREAM_IDLE_TIMEOUT_MS |
600000 |
Max silence between SSE chunks before aborting. Extended-thinking models rarely pause >90s. |
OMNIROUTE_SSE_COMMENTS |
(enabled) | Whether OmniRoute may emit SSE : comment lines (e.g. the : keepalive heartbeat). Set off to suppress comment-shaped heartbeats (no-op) for strict OpenAI-compatible clients that JSON.parse every SSE line; data: heartbeats are unaffected. Used by open-sse/utils/sseHeartbeat.ts. |
STREAM_READINESS_TIMEOUT_MS |
80000 |
Time to receive the first non-ping SSE event. Inherits REQUEST_TIMEOUT_MS when set. |
STREAM_READINESS_MAX_TIMEOUT_MS |
180000 |
Maximum adaptive first-event readiness window for large, tool-heavy, or high-reasoning streaming requests. |
OMNIROUTE_AGENT_GOAL_POLICY_ENABLED |
true |
Kill-switch for the /goal heuristic. Set false/0/off to fully disable detection — readiness timeouts and stream recovery are never elevated by request body/headers, mitigating client-controlled timeout amplification. |
OMNIROUTE_AGENT_GOAL_READINESS_MAX_TIMEOUT_MS |
600000 |
Maximum first-event readiness window for detected /goal agent runs or requests forced with x-omniroute-agent-goal. |
OMNIROUTE_AGENT_GOAL_STREAM_RECOVERY |
true |
Enable early stream recovery automatically for detected /goal agent runs. Set false/0/off to disable the goal-specific opt-in. This can only ADD recovery on top of the operator default — it never overrides an explicit STREAM_RECOVERY_ENABLED/DB settings opt-out. |
OMNIROUTE_CODEX_DROP_NONSTANDARD_EVENTS |
(off) | Strip non-standard codex.* SSE events (e.g. codex.rate_limits) that break the OpenAI SDK's responses.stream() with a 502. Set true/1/yes to enable. |
FETCH_HEADERS_TIMEOUT_MS |
= FETCH_TIMEOUT_MS |
Time to receive response headers. |
FETCH_BODY_TIMEOUT_MS |
= FETCH_TIMEOUT_MS |
Time to receive the full response body. |
FETCH_CONNECT_TIMEOUT_MS |
30000 |
TCP connection establishment timeout. |
FETCH_KEEPALIVE_TIMEOUT_MS |
4000 |
Keep-alive socket idle timeout. |
TLS_CLIENT_TIMEOUT_MS |
= FETCH_TIMEOUT_MS |
TLS fingerprint proxy (wreq-js) timeout. |
API_BRIDGE_PROXY_TIMEOUT_MS |
30000 |
Proxy hop timeout for /v1 bridge requests. |
FIRECRAWL_BASE_URL |
https://api.firecrawl.dev |
Point the Firecrawl web-fetch executor at a self-hosted instance (API key optional off-cloud). |
FIRECRAWL_TIMEOUT_MS |
30000 |
Per-request timeout for the Firecrawl web-fetch executor. |
API_BRIDGE_SERVER_REQUEST_TIMEOUT_MS |
300000 |
Overall server request timeout for the bridge. |
API_BRIDGE_SERVER_HEADERS_TIMEOUT_MS |
60000 |
Time to send response headers via the bridge. |
API_BRIDGE_SERVER_KEEPALIVE_TIMEOUT_MS |
5000 |
Bridge keep-alive idle timeout. |
API_BRIDGE_SERVER_SOCKET_TIMEOUT_MS |
0 |
Raw socket timeout (0 = disabled). |
SHUTDOWN_TIMEOUT_MS |
30000 |
Grace period on SIGTERM/SIGINT before force-exit. |
OMNIROUTE_DEFAULT_FETCH_TIMEOUT_MS |
120000 |
Fallback used by src/shared/utils/fetchTimeout.ts when FETCH_TIMEOUT_MS is unset. |
OMNIROUTE_CHATGPT_TLS_TIMEOUT_MS |
60000 |
Wire-level timeout for the bogdanfinn/tls-client koffi binding (chatgptTlsClient.ts). |
OMNIROUTE_CHATGPT_TLS_GRACE_MS |
10000 |
JS-side grace added on top of the wire timeout when the native binding is wedged. |
OMNIROUTE_CHATGPT_STREAM_FIRST_BYTE_TIMEOUT_MS |
30000 (30s) |
Max wait for the first streamed byte from the ChatGPT TLS sidecar (chatgptTlsClient.ts) before aborting a dead stream. Raise if upstream cold-starts exceed the window. |
OMNIROUTE_CLAUDE_TLS_TIMEOUT_MS |
60000 |
Wire-level timeout for the bogdanfinn/tls-client koffi binding (claudeTlsClient.ts). |
OMNIROUTE_CLAUDE_TLS_GRACE_MS |
10000 |
JS-side grace added on top of the wire timeout when the native binding is wedged. |
OMNIROUTE_PPLX_TLS_TIMEOUT_MS |
30000 |
Wire-level timeout for the bogdanfinn/tls-client koffi binding (perplexityTlsClient.ts). |
OMNIROUTE_PPLX_TLS_GRACE_MS |
10000 |
JS-side grace added on top of the wire timeout when the native binding is wedged. |
OMNIROUTE_GROK_TLS_TIMEOUT_MS |
60000 |
Wire-level timeout for the bogdanfinn/tls-client koffi binding (grokTlsClient.ts). |
OMNIROUTE_GROK_TLS_GRACE_MS |
10000 |
JS-side grace added on top of the wire timeout when the native binding is wedged. |
OMNIROUTE_BROWSER_POOL |
on |
Shared Playwright browser pool for browser-backed web-cookie chat (browserPool.ts); set off to disable. |
WEB_COOKIE_USE_BROWSER |
0 |
Opt a web-cookie chat request into the browser-backed path (browserBackedChat.ts); 1 to enable. |
Combo target attempts inherit the resolved upstream request timeout (FETCH_TIMEOUT_MS, or
REQUEST_TIMEOUT_MS when it supplies the fetch default). Set targetTimeoutMs in a combo,
combo defaults, or provider override only to make combo fallback faster; values above the
current upstream timeout are capped to the upstream timeout.
Circuit Breaker Thresholds
Provider-level circuit breaker tuning. Defaults reflect the scaled values used since v3.6 for 500+ connections.
| Variable | Default | Source File | Description |
|---|---|---|---|
OMNIROUTE_CIRCUIT_BREAKER_OAUTH_THRESHOLD |
8 |
open-sse/config/constants.ts |
Consecutive failure threshold for OAuth providers before the breaker trips. |
OMNIROUTE_CIRCUIT_BREAKER_OAUTH_RESET_MS |
60000 |
open-sse/config/constants.ts |
Reset window (ms) for OAuth provider breaker. |
OMNIROUTE_CIRCUIT_BREAKER_API_KEY_THRESHOLD |
12 |
open-sse/config/constants.ts |
Consecutive failure threshold for API-key providers. |
OMNIROUTE_CIRCUIT_BREAKER_API_KEY_RESET_MS |
30000 |
open-sse/config/constants.ts |
Reset window (ms) for API-key provider breaker. |
OMNIROUTE_CIRCUIT_BREAKER_LOCAL_THRESHOLD |
2 |
open-sse/config/constants.ts |
Consecutive failure threshold for local providers (Ollama, LM Studio, ...). |
OMNIROUTE_CIRCUIT_BREAKER_LOCAL_RESET_MS |
15000 |
open-sse/config/constants.ts |
Reset window (ms) for local provider breaker. |
PIN_DROP_BACKOFF_LEVEL |
2 |
open-sse/services/combo.ts |
Backoff depth at which a context-cache pin's provider is deemed durably unhealthy and the pin is dropped for failover. |
PIN_DROP_GRACE_MS |
20000 |
open-sse/services/combo.ts |
Anti-flap window (ms) tolerating brief transient cooldowns before dropping a context-cache pin. |
Scenarios
| Scenario | Configuration |
|---|---|
| Long-running code generation | REQUEST_TIMEOUT_MS=900000 (15 min) |
| Fast-fail for production API | API_BRIDGE_PROXY_TIMEOUT_MS=10000 |
| Extended thinking models | STREAM_IDLE_TIMEOUT_MS=300000 (5 min between chunks) |
16. Logging
The logging system writes to both stdout and rotated log files. All configuration is read by src/lib/logEnv.ts.
| Variable | Default | Description |
|---|---|---|
APP_LOG_LEVEL |
info |
Minimum log level: debug, info, warn, error. |
APP_LOG_FORMAT |
text |
Output format: text (human-readable) or json (structured). |
APP_LOG_TO_FILE |
true |
Write logs to file alongside stdout. |
APP_LOG_FILE_PATH |
logs/application/app.log |
Log file path (relative to project root or DATA_DIR). |
APP_LOG_MAX_FILE_SIZE |
50M |
Max file size before rotation. Accepts: 50M, 1G, 512K, or plain bytes. |
APP_LOG_RETENTION_DAYS |
7 |
Days to keep rotated application log files. |
APP_LOG_MAX_FILES |
20 |
Maximum rotated log file backups. |
CALL_LOG_RETENTION_DAYS |
7 |
Days to keep request/call log entries in the database. |
CALL_LOG_MAX_ENTRIES |
10000 |
Max call log entries in the in-memory buffer. |
CALL_LOGS_TABLE_MAX_ROWS |
100000 |
Max rows in the call_logs SQLite table before pruning. |
MAX_PENDING_REQUEST_AGE_MS |
3600000 (1 hour) |
Max age for orphaned active request log entries before in-memory cleanup. |
CALL_LOG_PIPELINE_CAPTURE_STREAM_CHUNKS |
true |
Store stream chunks in pipeline artifacts when call_log_pipeline_enabled=true. |
CALL_LOG_PIPELINE_MAX_SIZE_KB |
512 |
Max pipeline call log artifact size in KB when call_log_pipeline_enabled=true. |
PROXY_LOGS_TABLE_MAX_ROWS |
100000 |
Max rows in the proxy_logs SQLite table before pruning. |
APP_LOG_ROTATION_CHECK_INTERVAL_MS |
60000 (1 min) |
How often src/lib/logRotation.ts re-checks the active log file size. |
CHAT_LOG_TEXT_LIMIT |
65536 |
Max string length retained in chat log artifacts (default 64 KB). |
CHAT_LOG_ARRAY_TAIL_ITEMS |
24 |
Number of array items retained from the tail when truncating chat log payloads. |
CHAT_LOG_MAX_DEPTH |
6 |
Max nesting depth before chat log payloads are truncated. |
CHAT_LOG_MAX_OBJECT_KEYS |
80 |
Max object keys retained in chat log payloads (0 = unlimited). |
CHAT_DEBUG_FILE |
false |
When true, serializeArtifactForStorage skips size-based truncation. Debug only. |
17. Memory Optimization
| Variable | Default | Description |
|---|---|---|
OMNIROUTE_MEMORY_MB |
auto | Runtime V8 heap limit (MB). When unset, calibrated dynamically (~35% of system RAM, clamped to [512, 4096]); 512 is only the floor when total memory can't be read. Set explicitly to override. Docker standalone and omniroute serve use it to set --max-old-space-size. |
PROMPT_CACHE_MAX_SIZE |
50 |
Max cached system prompt entries. |
PROMPT_CACHE_MAX_BYTES |
2097152 (2 MB) |
Max total prompt cache size. |
PROMPT_CACHE_TTL_MS |
300000 (5 min) |
Prompt cache entry TTL. |
SEMANTIC_CACHE_MAX_SIZE |
100 |
Max cached temperature=0 responses. |
SEMANTIC_CACHE_MAX_BYTES |
4194304 (4 MB) |
Max total semantic cache size. |
SEMANTIC_CACHE_TTL_MS |
1800000 (30 min) |
Semantic cache entry TTL. |
STREAM_HISTORY_MAX |
50 |
Max recent stream events in the Dashboard live view buffer. |
CONTEXT_LENGTH_DEFAULT |
128000 |
Global fallback max context length for models without explicit config. |
USAGE_TOKEN_BUFFER |
100 |
Extra token headroom reserved when tracking usage quotas. |
Compression
| Variable | Default | Description |
|---|---|---|
OMNIROUTE_RTK_TRUST_PROJECT_FILTERS |
unset | Trust project .rtk/filters.json without a .rtk/trust.json hash. Use only in controlled local development. |
Memory Engine (plan 21)
Embedding layer, vector store and reranking knobs for the persistent memory subsystem (src/lib/memory/).
| Variable | Default | Description |
|---|---|---|
MEMORY_EMBEDDING_CACHE_TTL_MS |
300000 (5 min) |
TTL for the in-memory embedding cache (per source/model/dim signature). |
MEMORY_EMBEDDING_CACHE_MAX |
1000 |
Max LRU entries kept in the embedding cache. |
MEMORY_TRANSFORMERS_MODEL |
Xenova/all-MiniLM-L6-v2 |
HF repo id for the opt-in @huggingface/transformers local MiniLM pipeline (~23 MB int8, ~400 MB RAM). |
MEMORY_STATIC_MODEL |
minishlab/potion-base-8M |
HF repo id for the static potion/Model2Vec lookup-table embedder. Downloaded lazily into the cache dir. |
MEMORY_STATIC_CACHE_DIR |
<DATA_DIR>/embeddings |
Directory used to cache the static potion model files. Defaults under DATA_DIR when unset. |
MEMORY_VEC_TOP_K |
20 |
Default top-K used by the sqlite-vec brute-force vector search inside src/lib/memory/vectorStore.ts. |
MEMORY_RRF_K |
60 |
Reciprocal Rank Fusion constant k for hybrid FTS5 + vector retrieval (sqlite-vec recipe). |
HF_HUB_ENDPOINT |
https://huggingface.co |
Override Hugging Face Hub base URL used by staticPotion.ts (e.g. mirror endpoint for air-gapped setups). |
MEMORY_TYPED_DECAY_ENABLED |
false |
TV6 typed memory decay master switch. Opt-in (default off) — the sweep deletes decayed memories. With it off, access_count/last_accessed_at are pure telemetry and nothing is ever deleted. |
MEMORY_TYPED_DECAY_EPISODIC_DAYS |
30 |
TTL (days) after which an unused episodic memory decays. 0 makes episodic immune too. Durable types (factual/procedural/semantic) are always immune. The decay clock re-bases on last_accessed_at. |
MEMORY_TYPED_DECAY_ACCESS_IMMUNITY |
3 |
A memory injected >= this many times becomes immune to decay regardless of type. 0 disables access immunity. |
MEMORY_TYPED_DECAY_SWEEP_INTERVAL |
0 (disabled) |
Interval (seconds) for the optional periodic decay sweep in src/lib/memory/typedDecay.ts. 0/unset = no periodic sweep. Doubly opt-in: also requires MEMORY_TYPED_DECAY_ENABLED=true. |
Low-RAM Docker Example
OMNIROUTE_MEMORY_MB=128
PROMPT_CACHE_MAX_SIZE=20
PROMPT_CACHE_MAX_BYTES=524288 # 512 KB
SEMANTIC_CACHE_MAX_SIZE=25
SEMANTIC_CACHE_MAX_BYTES=1048576 # 1 MB
STREAM_HISTORY_MAX=10
18. Pricing Sync
Automatic model pricing data synchronization from external sources.
| Variable | Default | Source File | Description |
|---|---|---|---|
PRICING_SYNC_ENABLED |
false |
src/lib/pricingSync.ts |
Opt-in periodic pricing sync. |
PRICING_SYNC_INTERVAL |
86400 (24h) |
src/lib/pricingSync.ts |
Sync interval in seconds. |
PRICING_SYNC_SOURCES |
litellm |
src/lib/pricingSync.ts |
Comma-separated data sources. |
Arena ELO Sync
| Variable | Default | Source File | Description |
|---|---|---|---|
ARENA_ELO_SYNC_ENABLED |
true |
src/shared/constants/featureFlagDefinitions.ts |
Periodic Arena AI leaderboard ELO sync, configurable from Dashboard Feature Flags or with false to opt out. |
ARENA_ELO_SYNC_INTERVAL |
86400 (24h) |
src/lib/arenaEloSync.ts |
Sync interval in seconds. |
PromptQL Playground Provider (Unofficial/Experimental)
Reverse-engineered GraphQL session bridge for prompt.ql.app (src/shared/constants/providers/web-cookie.ts). All optional — defaults point at the public playground endpoints; override only for a self-hosted/alternate PromptQL deployment.
| Variable | Default | Source File | Description |
|---|---|---|---|
PROMPTQL_GRAPHQL_ENDPOINT |
https://data.prompt.ql.app/promptql/playground-v2-hge/v1/graphql |
open-sse/executors/promptql.ts |
GraphQL endpoint used for chat/session operations. |
PROMPTQL_CREDITS_ENDPOINT |
https://data.pro.ql.app/v1/graphql |
open-sse/executors/promptql.ts, open-sse/services/usage/promptql.ts |
GraphQL endpoint used to query credit balance/usage. |
PROMPTQL_TOKEN_REFRESH_URL |
https://auth.pro.ql.app/ddn/project/token |
open-sse/executors/promptql.ts |
Endpoint used for best-effort token refresh. |
PROMPTQL_POLL_TIMEOUT_MS |
180000 |
open-sse/executors/promptql.ts |
Max time (ms) to poll thread_events before timing out. |
19. Model Sync (Dev)
| Variable | Default | Source File | Description |
|---|---|---|---|
MODELS_DEV_SYNC_INTERVAL |
86400 (24h) |
src/lib/modelsDevSync.ts |
Development-time model catalog sync interval in seconds. |
CONTEXT_WINDOW_RECONCILE_INTERVAL |
86400 (24h) |
src/lib/contextWindowResolver.ts |
Interval (seconds) for the self-correcting context-window reconciler (5004): pins provider-declared windows from /models discovery as auto:discovery overrides when they diverge from the catalog. Set to 0 to disable. Reuses already-synced data (no new fetch); never overwrites manual overrides. |
20. Provider-Specific Settings
| Variable | Default | Source File | Description |
|---|---|---|---|
OPENROUTER_CATALOG_TTL_MS |
86400000 (24h) |
src/lib/catalog/openrouterCatalog.ts |
OpenRouter model catalog cache TTL. |
MODEL_CATALOG_INCLUDE_NAMES |
true |
src/shared/constants/featureFlagDefinitions.ts |
Include display-friendly name fields in /v1/models responses. Disable for clients that expect IDs only. |
NANOBANANA_POLL_TIMEOUT_MS |
120000 |
open-sse/handlers/imageGeneration.ts |
Max wait for NanoBanana image generation jobs. |
NANOBANANA_POLL_INTERVAL_MS |
2500 |
open-sse/handlers/imageGeneration.ts |
NanoBanana job polling frequency. |
DESIGNER_WEB_POLL_TIMEOUT_MS |
60000 |
open-sse/handlers/imageGeneration/providers/designerWeb.ts |
Max wait for microsoft-designer-web image generation jobs. |
DESIGNER_WEB_POLL_INTERVAL_MS |
2000 |
open-sse/handlers/imageGeneration/providers/designerWeb.ts |
microsoft-designer-web job polling frequency. |
AWS_REGION |
(unset) | src/lib/providers/validation.ts, open-sse/handlers/audioSpeech.ts |
Region used to construct AWS Bedrock endpoints (Kiro, audio). |
AWS_DEFAULT_REGION |
(unset) | src/lib/providers/validation.ts, open-sse/handlers/audioSpeech.ts |
Fallback when AWS_REGION is not set. |
CLOUDFLARE_ACCOUNT_ID |
(unset) | open-sse/executors/cloudflare-ai.ts |
Account ID for Cloudflare Workers AI. |
CLOUDFLARE_API_BASE |
https://api.cloudflare.com/client/v4 |
src/app/api/settings/proxy/cloudflare-deploy/route.ts |
Override the Cloudflare REST API base used by the proxy-pool Workers relay deployer (#4640 / 9router#1360). |
NEXT_PUBLIC_CLOUDFLARE_RELAY_DEFAULT_PROJECT |
omniroute-relay |
src/app/(dashboard)/dashboard/settings/components/proxy/CloudflareRelayModal.tsx |
Default worker project name suggested in the proxy-pool "Deploy Relay" modal. |
NEXT_PUBLIC_CLOUDFLARE_RELAY_ENABLED |
true |
src/app/(dashboard)/dashboard/settings/components/proxy/ProxyPoolTab.tsx |
Set to false to hide the Cloudflare Workers relay option from the Proxy Pool tab. |
CLOUDFLARED_BIN |
auto-detect | src/lib/cloudflaredTunnel.ts |
Custom path to cloudflared binary. |
DENO_DEPLOY_API_BASE |
https://api.deno.com/v2 |
src/app/api/settings/proxy/deno-deploy/route.ts |
Override the Deno Deploy REST API base used by the proxy-pool relay deployer (#4643 / 9router#1437). |
NEXT_PUBLIC_DENO_RELAY_DEFAULT_PROJECT |
omniroute-deno-relay |
src/app/(dashboard)/dashboard/settings/components/proxy/DenoRelayModal.tsx |
Default Deno Deploy app name suggested in the proxy-pool "Deploy Relay" modal. |
NEXT_PUBLIC_DENO_RELAY_ENABLED |
true |
src/app/(dashboard)/dashboard/settings/components/proxy/ProxyPoolTab.tsx |
Set to false to hide the Deno Deploy relay option from the Proxy Pool tab. |
SEARCH_CACHE_TTL_MS |
300000 (5 min) |
open-sse/services/searchCache.ts |
TTL for search API (Perplexity, Brave, etc.) response caching. |
ALLOW_MULTI_CONNECTIONS_PER_COMPAT_NODE |
false |
src/app/api/providers/route.ts |
Allow multiple simultaneous connections per OpenAI-compatible provider. |
ENABLE_CC_COMPATIBLE_PROVIDER |
false |
src/shared/utils/featureFlags.ts |
Reveal the experimental CC-compatible provider UI for Claude Code-only relays. |
NINEROUTER_HOST |
127.0.0.1 |
open-sse/executors/ninerouter.ts |
Override the host where the embedded 9router instance listens. |
NINEROUTER_PORT |
20130 |
open-sse/executors/ninerouter.ts |
Override the port where the embedded 9router instance listens. |
EMBED_WS_PROXY_HOST |
127.0.0.1 |
src/lib/services/embedWsProxy.ts |
Bind host for the embedded-service WebSocket proxy (loopback only by default). |
EMBED_WS_PROXY_PORT |
20131 |
src/lib/services/embedWsProxy.ts |
Port for the embedded-service WebSocket proxy server. |
CLIPROXYAPI_HOST |
127.0.0.1 |
open-sse/executors/cliproxyapi.ts |
CLIProxyAPI bridge host (legacy integration). |
CLIPROXYAPI_PORT |
5544 |
open-sse/executors/cliproxyapi.ts |
CLIProxyAPI bridge port. |
CLIPROXYAPI_CONFIG_DIR |
~/.cli-proxy-api |
src/lib/versionManager/processManager.ts |
CLIProxyAPI config directory. |
MUX_SERVICE_PORT |
8322 |
src/lib/services/bootstrap.ts |
Override the port where the embedded Mux (coder/mux) agent-orchestration daemon listens (always 127.0.0.1). |
LOCAL_HOSTNAMES |
(empty) | open-sse/config/providerRegistry.ts |
Comma-separated additional hostnames treated as "local" (Docker service names, etc.). |
ENABLE_CC_COMPATIBLE_PROVIDER is only for third-party relays that accept Claude Code clients
exclusively. OmniRoute rewrites requests so those relays accept them. If you only want to use
Claude Code CLI, or you are not sure what these relays are, keep this disabled and add a regular
Anthropic-compatible provider instead.
21. Proxy Health
| Variable | Default | Source File | Description |
|---|---|---|---|
PROXY_FAST_FAIL_TIMEOUT_MS |
2000 |
src/lib/proxyHealth.ts |
Fast-fail health check timeout. |
PROXY_LATENCY_WINDOW_HOURS |
3 |
src/lib/db/proxies.ts |
Time window (hours) for calculating the average latency of candidate proxies in the latency-optimized pool strategy. |
PROXY_HEALTH_CACHE_TTL_MS |
30000 |
src/lib/proxyHealth.ts |
Health check result cache TTL. |
PROXY_HEALTH_UNHEALTHY_CACHE_TTL_MS |
2000 |
src/lib/proxyHealth.ts |
Cache TTL for failed proxy health probes. Keep this shorter than PROXY_HEALTH_CACHE_TTL_MS so transient proxy timeouts under high concurrency retry quickly without disabling fast-fail for truly dead proxies. |
PROXY_HEALTH_ENABLED |
true |
src/lib/proxyHealth/scheduler.ts |
Set false to disable the background proxy health scheduler that periodically probes registered proxies. |
PROXY_HEALTH_INTERVAL_MS |
600000 |
src/lib/proxyHealth/scheduler.ts |
Background health-scheduler sweep interval in ms (minimum 60000). |
PROXY_HEALTH_TEST_URL |
https://httpbin.org/ip |
src/lib/proxyHealth/scheduler.ts |
Reachability probe target used by the scheduler and the /api/settings/proxies/auto-test endpoint. Point it at an internal/self-hosted URL to avoid the public default. |
PROXY_HEALTH_AUTO_DEACTIVATE |
false |
src/lib/proxyHealth/statusPolicy.ts |
When false (default), automated reachability probes (the scheduler + the /api/settings/proxies/auto-test "Test All" button) are read-only and never write a proxy's status — only the operator sets active/inactive, so a flaky probe can't strand an assigned proxy (#6246). Set true to restore the legacy test-and-set behaviour. |
PROXY_AUTO_REMOVE |
false |
src/lib/proxyHealth/scheduler.ts |
Set true to let the scheduler auto-remove proxies after repeated consecutive failures. |
PROXY_AUTO_REMOVE_AFTER |
3 |
src/lib/proxyHealth/scheduler.ts |
Consecutive failures before the scheduler auto-removes a proxy (when PROXY_AUTO_REMOVE=true). |
OMNIROUTE_CONTROL_PLANE_PROXY_DIRECT_FALLBACK |
false |
src/shared/constants/featureFlagDefinitions.ts |
Allow OAuth and provider validation flows to bypass a pinned proxy and connect directly when proxy reachability pre-checks fail. Effective precedence is Feature Flags DB override > env var > default. |
RATE_LIMIT_MAX_WAIT_MS |
15000 (15s) |
open-sse/services/rateLimitManager.ts |
Max time to wait on a 429 before failing the request. |
RATE_LIMIT_MAX_QUEUE_DEPTH |
0 (disabled) |
open-sse/services/rateLimitManager.ts |
Queue admission cap: reject with a 429 queue_full once this many requests are already queued. 0 = unbounded (default). |
RATE_LIMIT_AUTO_ENABLE |
(unset) | open-sse/services/rateLimitManager.ts |
Force the auto-enable rate limit safety net on/off regardless of the persisted Dashboard setting. Accepts true/1/on to force on, false/0/off to force off. |
PROVIDER_COOLDOWN_ENABLED |
(unset → off) | open-sse/services/providerCooldownTracker.ts |
Opt-in global cross-request provider/connection cooldown tracking. OFF by default (overlaps Connection Cooldown / Provider Circuit Breaker). Accepts true/1/on to enable. |
PROVIDER_COOLDOWN_MIN_MS |
5000 |
open-sse/services/providerCooldownTracker.ts |
Minimum cooldown (ms) before a failed provider/connection is retried. Scaled exponentially with consecutive failures. Only used when PROVIDER_COOLDOWN_ENABLED. |
PROVIDER_COOLDOWN_MAX_MS |
300000 (5 min) |
open-sse/services/providerCooldownTracker.ts |
Maximum cooldown (ms) cap before a failed provider/connection is retried regardless. Only used when PROVIDER_COOLDOWN_ENABLED. |
STREAM_RECOVERY_ENABLED |
(unset → off) | src/lib/resilience/settings.ts (seed) → open-sse/services/streamRecovery.ts (logic) |
What: transparent recovery of truncated upstream streams (free-claude-code port). Holds the opening SSE window up to STREAM_RECOVERY.HOLDBACK_MS (750 ms) so a pre-commit cutoff — one that happens before any byte reaches the client — is re-opened and retried invisibly. When to enable: flaky/upstreams that frequently 0-byte-truncate at stream start; leave OFF if you cannot afford up to 750 ms of added time-to-first-token on every stream. Accepts true/1/on. Seeds the persisted Resilience setting; the Dashboard setting wins once set. |
STREAM_RECOVERY_MIDSTREAM_ENABLED |
(unset → off) | src/lib/resilience/settings.ts (seed) → open-sse/services/streamRecovery.ts (logic) |
What: mid-stream continuation (Fase 4.4) — after a post-commit truncation (bytes already reached the client), re-request with the partial text as an assistant prefill and stitch the missing suffix. Plain-text OpenAI-compatible streams only; never fires with a tool call in flight. When to enable: long generations that get cut mid-answer and you accept the recovered tail arriving as one burst rather than token-by-token. Independent of STREAM_RECOVERY_ENABLED (different risk profile). Accepts true/1/on. |
HEALTHCHECK_STAGGER_MS |
3000 |
src/lib/tokenHealthCheck.ts |
Stagger interval (ms) between provider token healthchecks at startup. |
HEALTHCHECK_JITTER_MIN_MS |
500 |
src/lib/tokenHealthCheck.ts |
Minimum randomized jitter (ms) added on top of HEALTHCHECK_STAGGER_MS between provider token healthchecks, to prevent bursting (Issue #1220). |
HEALTHCHECK_JITTER_MAX_MS |
5000 |
src/lib/tokenHealthCheck.ts |
Maximum randomized jitter (ms) added on top of HEALTHCHECK_STAGGER_MS between provider token healthchecks, to prevent bursting (Issue #1220). |
HEALTHCHECK_BATCH_SIZE |
20 |
src/lib/tokenHealthCheck.ts |
Concurrent-check batch size for the startup token-healthcheck sweep; larger values check more connections in parallel, smaller values reduce burst load (Issue #7875, regression of #7719). |
REQUEST_RETRY |
2 |
src/sse/services/cooldownAwareRetry.ts |
Number of automatic retries on model-scoped cooldown responses before returning error to client. |
MAX_RETRY_INTERVAL_SEC |
30 |
src/sse/services/cooldownAwareRetry.ts |
Max backoff interval (seconds) between cooldown retries. Capped by this value regardless of upstream Retry-After. |
HEADROOM_URL |
http://localhost:8787 |
src/lib/headroom/detect.ts |
Headroom token-saver proxy URL. The dashboard lifecycle (api/headroom/*) spawns a local headroom-ai CLI on loopback by default; override only to point at an external Docker sidecar proxy. |
Stream-recovery tuning constants (not env vars)
The two STREAM_RECOVERY_* flags above are the only operator-facing toggles. The
recovery behavior is otherwise tuned by hardcoded constants in
open-sse/config/constants.ts (STREAM_RECOVERY), shown here for reference —
changing them requires a code edit, not an env var:
STREAM_RECOVERY.HOLDBACK_MS = 750— how long the opening SSE window is held so an early truncation can be retried before any byte is committed to the client.STREAM_RECOVERY.BUFFER_MAX_BYTES = 65536— hard cap on the held window; commit (flush + passthrough) as soon as this many bytes accumulate, regardless of the timer.STREAM_RECOVERY.EARLY_RETRY_MAX = 4— max transparent re-opens of the upstream stream while the holdback is still uncommitted.
Per-provider sliding-window rate limit (no env var): the FCC-ported per-provider sliding-window rate-limit fallback exists in code (
open-sse/services/providerDefaultRateLimit.ts, wired throughopen-sse/services/rateLimitManager.ts) but ships with an empty default map and has no operator env var today — it is enabled only via a test hook / code edit. It is intentionally not listed in the table above. The per-(token, IP)relay limiter that does have a knob isRELAY_IP_PER_MINUTE(§3 Network & Ports).
22. Debugging
Caution
These variables produce verbose output and may leak sensitive data. Never enable in production.
| Variable | Default | Source File | Description |
|---|---|---|---|
CURSOR_DEBUG |
(unset) | open-sse/executors/cursor.ts |
Set 1 to enable verbose Cursor executor logs (decoded SSE chunks, etc.). |
CURSOR_STREAM_DEBUG |
(unset) | open-sse/executors/cursor.ts |
Backward-compatible alias of CURSOR_DEBUG. |
CURSOR_DUMP_FILE |
(unset) | open-sse/executors/cursor.ts |
Optional file path that receives raw decoded Cursor chunks when CURSOR_DEBUG=1. |
CURSOR_STREAM_TIMEOUT_MS |
300000 |
open-sse/executors/cursor.ts |
Stream idle timeout (ms) for the Cursor executor. |
CURSOR_TOOL_DIRECTIVE |
enabled (!== "0") |
open-sse/executors/cursor.ts |
Tool-commit directive that makes composer-2.5 reliably issue tool calls. Set 0 to disable. |
CURSOR_IMAGE_FETCH_TIMEOUT_MS |
15000 |
open-sse/utils/cursorImages.ts |
Per-image fetch timeout (ms) for remote image_url vision input. |
CURSOR_STATE_DB_PATH |
(probed) | open-sse/utils/cursorVersionDetector.ts |
Override the Cursor IDE state DB lookup used for IDE version detection. |
CURSOR_AGENT_CLI_VERSION |
(detect / pin) | open-sse/utils/cursorAgentCliVersion.ts |
Agent CLI build id (YYYY.MM.DD-<hash>) for x-cursor-client-version: cli-… on Agent Run. |
CURSOR_DATA_DIR |
(probed) | open-sse/utils/cursorAgentCliVersion.ts |
Override Cursor Agent CLI data dir (…/versions/<id>); same var the official agent uses. |
CURSOR_TOKEN |
(unset) | scripts/ad-hoc/cursor-tap.cjs |
Direct Cursor bearer token used by developer tooling. |
OMNIROUTE_LOG_REQUEST_SHAPE |
enabled (!== "0") |
src/app/api/v1/chat/completions/route.ts |
Log content-type/length markers for large chat payloads. Set "0" to silence. |
DEBUG_RESPONSES_SSE_TO_JSON |
(unset) | open-sse/handlers/responseTranslator.ts |
Set true to log Responses API SSE→JSON translation details. |
NEXT_PUBLIC_OMNIROUTE_E2E_MODE |
(unset) | E2E test harness | Set true to enable E2E test mode (relaxed auth, test hooks). |
23. GitHub Integration
Allow users to report issues directly from the Dashboard.
| Variable | Default | Source File | Description |
|---|---|---|---|
GITHUB_ISSUES_REPO |
(unset) | src/app/api/v1/issues/report/route.ts |
Repository in owner/repo format. |
GITHUB_ISSUES_TOKEN |
(unset) | src/app/api/v1/issues/report/route.ts |
GitHub Personal Access Token with issues:write scope. |
GITHUB_TOKEN |
(unset) | issue triage / cloud agent helpers | Generic GitHub access token used as fallback for GITHUB_ISSUES_TOKEN and consumed by cloud agent helpers in src/lib/cloudAgent/*. |
Deployment Scenarios
For relay backend SRE guidance (ts/bifrost/auto behavior, 9router vs CLIProxyAPI placement, and high-throughput fallback strategy), see Relay Backend Strategy.
Minimal Local Development
JWT_SECRET=$(openssl rand -base64 48)
API_KEY_SECRET=$(openssl rand -hex 32)
INITIAL_PASSWORD=dev123
PORT=20128
NODE_ENV=development
Docker Production
JWT_SECRET=<generated>
API_KEY_SECRET=<generated>
INITIAL_PASSWORD=<generated>
STORAGE_ENCRYPTION_KEY=<generated>
DATA_DIR=/data
PORT=20128
API_PORT=20129
NODE_ENV=production
AUTH_COOKIE_SECURE=true
REQUIRE_API_KEY=true
NEXT_PUBLIC_BASE_URL=https://omniroute.example.com
BASE_URL=http://localhost:20128
OMNIROUTE_MEMORY_MB=512
CORS_ORIGIN=https://your-frontend.example.com
Air-Gapped / CI
JWT_SECRET=test-jwt-secret-for-ci
API_KEY_SECRET=test-api-key-secret-for-ci
INITIAL_PASSWORD=testpass
NODE_ENV=production
OMNIROUTE_DISABLE_BACKGROUND_SERVICES=true
APP_LOG_TO_FILE=false
VPS with Reverse Proxy (nginx + Cloudflare)
JWT_SECRET=<generated>
API_KEY_SECRET=<generated>
STORAGE_ENCRYPTION_KEY=<generated>
PORT=20128
AUTH_COOKIE_SECURE=true
REQUIRE_API_KEY=true
NEXT_PUBLIC_BASE_URL=https://omniroute.example.com
BASE_URL=http://127.0.0.1:20128
CORS_ORIGIN=https://omniroute.example.com
ENABLE_TLS_FINGERPRINT=true
CLI_COMPAT_ALL=1
24. Skills Sandbox (v3.8.0+)
Limits and safety knobs applied when the Skills framework (src/lib/skills/) executes user-defined automations in a sandboxed environment.
| Variable | Default | Source File | Description |
|---|---|---|---|
SKILLS_SANDBOX_TIMEOUT_MS |
10000 (10 s) |
src/lib/skills/builtins.ts |
Per-execution wall-clock timeout for sandboxed skill code. Hard cap; anything longer is killed. |
SKILLS_EXECUTION_TIMEOUT_MS |
(falls back to SKILLS_SANDBOX_TIMEOUT_MS) |
src/lib/skills/ |
High-level skill orchestration timeout. Set higher than SKILLS_SANDBOX_TIMEOUT_MS to allow multi-step workflows. |
SKILLS_MAX_FILE_BYTES |
1048576 (1 MB) |
src/lib/skills/builtins.ts |
Max bytes a skill may read from any single sandboxed file. |
SKILLS_MAX_HTTP_RESPONSE_BYTES |
256000 (250 KB) |
src/lib/skills/builtins.ts |
Max bytes captured from any single HTTP response inside a skill. |
SKILLS_MAX_SANDBOX_OUTPUT_CHARS |
100000 |
src/lib/skills/builtins.ts |
Hard cap on stdout/stderr characters returned from a sandbox invocation. |
SKILLS_SANDBOX_NETWORK_ENABLED |
false |
src/lib/skills/builtins.ts |
Set 1/true to allow outbound network from inside the sandbox. Defaults to isolated for safety. |
SKILLS_ALLOWED_SANDBOX_IMAGES |
(empty) | src/lib/skills/builtins.ts |
Comma-separated allowlist of container images permitted for sandbox execution. Empty means built-in default only. |
SKILLS_SANDBOX_DOCKER_IMAGE |
(built-in default) | src/lib/skills/ |
Container image used when spawning a Docker-backed sandbox. Override to pin a custom hardened base image. |
SKILLS_SANDBOX_RUNTIME |
auto |
src/lib/skills/sandbox.ts, src/lib/skills/containerProvider.ts |
Container runtime for skill sandboxing: auto | docker | apple | wsl | orbstack | podman. auto picks the best installed runtime per host OS (Apple Container/OrbStack on macOS, WSL Container on Windows, Podman on Linux), falling back to Docker. |
Caution
Enabling
SKILLS_SANDBOX_NETWORK_ENABLED=trueopens an egress path from arbitrary skill code. Pair withOUTBOUND_SSRF_GUARD_ENABLED=trueand a strictCORS_ORIGIN/proxy policy in shared deployments.
25. Provider Quotas, Tunnels, Backups & Misc Runtime
Provider quota endpoints, network tunnels (Tailscale, Ngrok, MITM debug proxy), the 1Proxy egress pool, database backups and small per-feature overrides referenced by the executor layer or scripts.
| Variable | Default | Source File | Description |
|---|---|---|---|
REDIS_URL |
redis://localhost:6379 |
src/shared/utils/rateLimiter.ts |
Redis connection string for the rate limiter backend. |
ALIBABA_CODING_PLAN_HOST |
(production host) | open-sse/services/bailianQuotaFetcher.ts |
Override the host used to fetch Alibaba Bailian coding-plan quotas. |
ALIBABA_CODING_PLAN_QUOTA_URL |
derived from host | open-sse/services/bailianQuotaFetcher.ts |
Full quota URL override for Alibaba Bailian. |
CONTEXT_RESERVE_TOKENS |
1024 |
open-sse/services/contextManager.ts |
Tokens reserved for completion output when computing prompt budgets. |
MODEL_ALIAS_COMPAT_ENABLED |
enabled | open-sse/services/model.ts |
Toggle the legacy model-alias compatibility layer used by older clients. |
OMNIROUTE_EMERGENCY_FALLBACK |
enabled | open-sse/services/emergencyFallback.ts |
Set false (or 0) to disable the emergency budget-exhaustion fallback that reroutes failed requests to the free nvidia/openai/gpt-oss-120b model. Effective precedence is Feature Flags DB override > env var > default; if unavailable, the service falls back to the raw env value. |
COMMAND_CODE_CALLBACK_PORT |
(unset) | src/app/api/providers/command-code/auth/shared.ts |
Local port used for OAuth-style callbacks from the Command Code CLI helper. |
COMMAND_CODE_VERSION |
0.33.2 |
open-sse/executors/commandCode.ts |
Value sent as the x-command-code-version header to the Command Code upstream. Override to bump the CLI version. |
MITM_LOCAL_PORT |
443 |
src/mitm/server.cjs |
Local bind port for the MITM debug proxy. |
MITM_DISABLE_TLS_VERIFY |
0 |
src/mitm/server.cjs |
Set 1 to disable upstream TLS verification (development only). |
MITM_IDLE_TIMEOUT_MS |
60000 |
src/mitm/socketTimeouts.ts, src/mitm/server.cjs |
Idle socket timeout (ms) for proxied connections; idle sockets past this are torn down to avoid leaking half-open tunnels. |
MITM_VERBOSE |
1 |
src/mitm/server.cjs, src/mitm/_internal/bypass.cjs |
Routing-decision log verbosity: 0 silences, higher values log more bypass/route decisions. |
MITM_ROOT_CA_ENABLED |
false |
src/mitm/manager.ts |
Set true to opt in to the root-CA + per-host-leaf cert model (#6684). Fresh installs get it automatically; installs with a pre-existing trusted legacy leaf keep the legacy fixed-SAN cert unless opted in. |
MITM_CERT_MODE |
legacy |
src/mitm/manager.ts, src/mitm/server.cjs |
Set BY the MITM manager for the spawned proxy process (root-ca | legacy) — reflects the cert-migration decision; not meant to be set manually. |
OMNIROUTE_NO_SUDO |
0 |
src/mitm/systemCommands.ts |
Set 1 (truthy) to strip the leading sudo from MITM cert-trust commands — for root-less / user-namespaced deployments where the operator trusts the CA manually (e.g. via Node's extra-CA-certs mechanism). |
SKIP_ANTIGRAVITY_DNS |
(unset) | src/mitm/dns/provision.ts |
Set true to skip provisioning /etc/hosts DNS entries for the Antigravity proxy hostnames entirely — for containers with no sudo/root available. |
OMNIROUTE_SKIP_DNS_WRITE |
(unset) | src/mitm/dns/dnsConfig.ts |
Set 1 to skip writing to the hosts file when adding/removing DNS entries — for sandboxed or read-only test environments. |
OMNIROUTE_SKIP_SYSTEM_TRUST |
0 |
src/mitm/cert/install.ts, src/mitm/tproxy/caTrust.ts |
Test/CI-only guard: set 1 to make cert trust install/uninstall a no-op so the suite never mutates the OS trust store. Set automatically by the test setup and CI workflows. |
CHANGELOG_BASE_REF |
(auto) | scripts/check/check-changelog-integrity.mjs |
Explicit base ref for the anti CHANGELOG-eat gate (defaults to the PR base branch in CI, or the highest release/v*). |
ALLOW_CHANGELOG_REMOVALS |
0 |
scripts/check/check-changelog-integrity.mjs |
Set 1 to turn intentional CHANGELOG bullet removals into a report instead of a failure (justify in the PR body). |
ONEPROXY_ENABLED |
true |
src/lib/oneproxySync.ts |
Enable the 1Proxy egress pool sync. |
ONEPROXY_API_URL |
https://1proxy-api.aitradepulse.com |
src/lib/oneproxySync.ts |
1Proxy service API URL override. |
ONEPROXY_MAX_PROXIES |
500 |
src/lib/oneproxySync.ts |
Maximum proxies imported per sync. |
ONEPROXY_MIN_QUALITY_THRESHOLD |
50 |
src/lib/oneproxySync.ts |
Minimum quality score for imported proxies. |
FREE_PROXY_AUTO_SYNC_ENABLED |
false |
src/lib/freeProxyProviders/scheduler.ts |
Set true to enable the background free-proxy pool auto-sync scheduler. Opt-in, off by default. |
FREE_PROXY_AUTO_SYNC_INTERVAL_MS |
1800000 |
src/lib/freeProxyProviders/scheduler.ts |
Auto-sync interval in milliseconds (default 30 min). |
FREE_PROXY_1PROXY_ENABLED |
true |
src/lib/freeProxyProviders/oneproxy.ts |
Enable the 1proxy free proxy source. Set to false to disable. |
FREE_PROXY_1PROXY_API_URL |
(see oneproxy.ts) | src/lib/freeProxyProviders/oneproxy.ts |
1proxy API URL override. |
FREE_PROXY_1PROXY_MAX |
500 |
src/lib/freeProxyProviders/oneproxy.ts |
Maximum proxies fetched per sync from 1proxy. |
FREE_PROXY_1PROXY_MIN_QUALITY |
50 |
src/lib/freeProxyProviders/oneproxy.ts |
Minimum quality score threshold for 1proxy imports. |
FREE_PROXY_PROXIFLY_ENABLED |
true |
src/lib/freeProxyProviders/proxifly.ts |
Enable the Proxifly free proxy source. Set to false to disable. |
FREE_PROXY_PROXIFLY_QUANTITY |
100 |
src/lib/freeProxyProviders/proxifly.ts |
Number of proxies to fetch per Proxifly sync. |
FREE_PROXY_PROXIFLY_ANONYMITY |
elite |
src/lib/freeProxyProviders/proxifly.ts |
Anonymity level filter for Proxifly (elite, anonymous, transparent). |
FREE_PROXY_IPLOCATE_ENABLED |
false |
src/lib/freeProxyProviders/iplocate.ts |
Enable the IPLocate free proxy source. Opt-in only. |
FREE_PROXY_IPLOCATE_BASE_URL |
https://raw.githubusercontent.com/iplocate/free-proxy-list/main/protocols |
src/lib/freeProxyProviders/iplocate.ts |
IPLocate proxy list base URL override. |
FREE_PROXY_WEBSHARE_ENABLED |
true |
src/lib/freeProxyProviders/webshare.ts |
Enable the Webshare proxy pool source. Set to false to disable; also requires FREE_PROXY_WEBSHARE_API_KEY to be set. |
FREE_PROXY_WEBSHARE_API_KEY |
(none) | src/lib/freeProxyProviders/webshare.ts |
Webshare account API token (Authorization: Token <key>). Required — the provider stays disabled without it. |
FREE_PROXY_WEBSHARE_API_URL |
https://proxy.webshare.io/api/v2/proxy/list/ |
src/lib/freeProxyProviders/webshare.ts |
Webshare proxy list API URL override. |
FREE_PROXY_WEBSHARE_MAX |
500 |
src/lib/freeProxyProviders/webshare.ts |
Maximum proxies imported per Webshare sync. |
NEXT_PUBLIC_VERCEL_RELAY_ENABLED |
true |
src/app/(dashboard)/…/ProxyPoolTab.tsx |
Show/hide the Deploy Vercel Relay button in the Proxy Pool tab. |
VERCEL_API_BASE |
https://api.vercel.com |
src/app/api/settings/proxy/vercel-deploy/route.ts |
Vercel API base URL override (for testing). |
NEXT_PUBLIC_VERCEL_RELAY_DEFAULT_PROJECT |
omniroute-relay |
src/app/(dashboard)/…/VercelRelayModal.tsx |
Default project name pre-filled in the Vercel Relay deploy modal. |
TAILSCALE_BIN |
(auto-detect) | src/lib/tailscaleTunnel.ts |
Explicit path to the tailscale binary. |
TAILSCALED_BIN |
(auto-detect) | src/lib/tailscaleTunnel.ts |
Explicit path to the tailscaled daemon binary. |
TAILSCALE_AUTHKEY |
(unset) | src/lib/tailscaleTunnel.ts |
Pre-shared Tailscale auth key for non-interactive / headless tailscale up (passed via --auth-key=). When unset, login falls back to the interactive browser auth URL. |
NGROK_AUTHTOKEN |
(unset) | src/lib/ngrokTunnel.ts |
Authenticates outbound ngrok tunnels. |
DB_BACKUP_MAX_FILES |
20 |
src/lib/db/backup.ts |
Maximum SQLite backup files retained on disk. Overrides the value saved from Settings → Database backup retention. |
DB_BACKUP_RETENTION_DAYS |
0 |
src/lib/db/backup.ts |
Maximum age (days) of retained backups. 0 disables age-based pruning. Overrides the value saved from Settings → Database backup retention. |
OMNIROUTE_TLS_PROXY_URL |
(unset) | open-sse/services/chatgptTlsClient.ts |
Override the TLS sidecar URL for tests. Production should leave unset. |
CONTAINER_HOST |
docker |
scripts/check-permissions.sh |
Container runtime hint for the entrypoint permission check. Set to podman under rootless Podman so the fix instructions use podman unshare chown instead of sudo chown. |
QUOTA_STORE_DRIVER |
sqlite |
src/lib/quota/storeFactory.ts |
Quota-share consumption store backend: sqlite (default) or redis. |
QUOTA_STORE_REDIS_URL |
(unset) | src/lib/quota/storeFactory.ts |
Redis connection string used when QUOTA_STORE_DRIVER=redis (e.g. redis://localhost:6379). |
QUOTA_SATURATION_THRESHOLD |
0.5 |
src/lib/quota/enforce.ts |
Pool saturation ratio (0..1); at/above it the pool enters strict mode (no borrowing). |
QUOTA_SOFT_DEPRIORITIZE_FACTOR |
0.7 |
open-sse/services/combo.ts |
Score multiplier (0..1) applied to a target when the soft quota policy deprioritizes it. |
STATUS_SOFT_DEPRIORITIZE_FACTOR |
0.5 |
open-sse/services/combo/autoStrategy.ts |
Score multiplier (0..1) applied to an exhausted provider (credits_exhausted/rate_limited) in auto-combo scoring when the preflight quota cutoff is OFF (#4540). |
QUOTA_CONSUMPTION_RETENTION_DAYS |
14 |
src/lib/db/quotaConsumption.ts |
Retention window (days) for quota_consumption buckets before GC (gcQuotaConsumption). |
QUOTA_PREFLIGHT_CUTOFF_ENABLED |
false |
src/lib/resilience/settings.ts |
Opt-in (default OFF): enables the auto-routing hard quota cutoff that drops low-quota candidates before scoring. |
OMNIROUTE_AUTO_FREE_FALLBACK_TO_FULL_POOL |
false |
open-sse/services/autoCombo/virtualFactory.ts |
Opt-in (default OFF): when an auto/<category>:<tier> filter matches no connected candidates, restore the legacy behavior of falling back to the full (unfiltered) pool instead of returning an empty pool. Default OFF makes :free mean "free tier only". |
AGENTBRIDGE_UPSTREAM_CA_CERT |
(unset) | src/mitm/manager.ts |
Extra CA certificate (PEM) trusted for AgentBridge upstream TLS connections. |
INSPECTOR_BUFFER_SIZE |
1000 |
src/mitm/inspector/buffer.ts |
Max captured requests held in the Traffic Inspector ring buffer. |
INSPECTOR_MAX_BODY_KB |
1024 |
src/mitm/inspector/buffer.ts |
Max captured request/response body size (KB) before truncation. |
INSPECTOR_HTTP_PROXY_PORT |
8080 |
src/mitm/inspector/httpProxyServer.ts |
Local port for the Traffic Inspector HTTP proxy. |
INSPECTOR_HTTP_PROXY_AUTOSTART |
false |
src/mitm/inspector/httpProxyServer.ts |
Auto-start the inspector HTTP proxy on boot. |
INSPECTOR_TLS_INTERCEPT |
false |
src/lib/inspector/captureState.ts |
Enable TLS interception (MITM) for captured HTTPS traffic. |
INSPECTOR_LLM_HOSTS_EXTRA |
(unset) | src/lib/inspector/captureState.ts |
Extra hostnames (comma-separated) treated as LLM endpoints for capture. |
INSPECTOR_MASK_SECRETS |
true |
src/mitm/inspector/buffer.ts |
Mask secrets (auth headers / API keys) in captured traffic. |
INSPECTOR_SYSTEM_PROXY_GUARD_MINUTES |
30 |
src/app/api/tools/traffic-inspector/capture-modes/system-proxy/route.ts |
Minutes before the system-proxy guard auto-reverts OS proxy settings. |
INSPECTOR_INTERNAL_INGEST_TOKEN |
(auto) | src/app/api/tools/traffic-inspector/internal/ingest/route.ts |
Token authenticating internal capture ingest into the inspector. |
PLAYGROUND_COMPARE_MAX_COLUMNS |
4 |
src/app/(dashboard)/dashboard/playground/ |
Max number of side-by-side columns in the Playground compare mode. |
PLAYGROUND_IMPROVE_PROMPT_DEFAULT_MODEL |
(unset) | src/app/(dashboard)/dashboard/playground/ |
Default model for the Playground 'improve prompt' action (falls back to the active model when unset). |
BIFROST_ENABLED |
1 |
src/app/api/v1/relay/chat/completions/bifrost/route.ts |
Master kill switch for the bifrost sidecar proxy. When set to 0, the route returns 503 with the X-Bifrost-Killswitch header and the operator is bounced to the TS path. Use to disable the sidecar without redeploying (tier-1 router incident, key rotation). |
BIFROST_BASE_URL |
(unset) | src/app/api/v1/relay/chat/completions/bifrost/route.ts |
When set, the Bifrost sidecar proxy route forwards /v1/chat/completions traffic to this Go gateway instead of the TS relay handler. Unset → 503-with-fallback. Trailing slash is stripped. |
BIFROST_PORT |
8080 |
src/lib/services/bootstrap.ts |
Port the supervised Bifrost embedded service binds to (127.0.0.1:<port>) when OmniRoute manages the Bifrost sidecar lifecycle. Defaults to 8080. |
BIFROST_API_KEY |
(unset) | src/app/api/v1/relay/chat/completions/bifrost/route.ts |
API key for the Bifrost gateway (sent as Authorization: Bearer ...). If unset, the route expects the request to carry a valid OmniRoute API key; this key is for gateway-side auth only. |
BIFROST_STREAMING_ENABLED |
true |
src/app/api/v1/relay/chat/completions/bifrost/route.ts |
When true, the Bifrost sidecar route streams responses back via SSE through the gateway rather than the TS streaming executor. Set to 0 to force non-streaming JSON responses through the gateway. |
BIFROST_TIMEOUT_MS |
30000 |
src/app/api/v1/relay/chat/completions/bifrost/route.ts |
Per-request timeout when proxying to the Bifrost gateway (ms). On timeout the route returns the TS relay path via the X-Bifrost-Fallback header. |
OMNIROUTE_BIFROST_KEY |
(unset) | src/app/api/v1/relay/chat/completions/bifrost/route.ts |
Alias for BIFROST_API_KEY (used by scripts that read the env via OMNIROUTE_*). BIFROST_API_KEY takes precedence when both are set. |
OMNIROUTE_RELAY_BACKEND |
ts / auto |
src/app/api/v1/relay/chat/completions/routingBackend.ts |
Relay backend for /api/v1/relay/chat/completions: ts | bifrost | auto. ts = TypeScript relay (default when Bifrost unconfigured); auto selects Bifrost when BIFROST_BASE_URL is set and BIFROST_ENABLED ≠ 0, with automatic TS fallback if the sidecar is unreachable; bifrost forces Bifrost (strict, no fallback). Auth/rate-limit/injection-guard/allowlist always run in the Next route first. Responses carry X-Routing-Backend / X-Routing-Fallback / X-Routing-Fallback-Reason. |
RELAY_ROUTING_BACKEND |
(unset) | src/app/api/v1/relay/chat/completions/routingBackend.ts |
Accepted alias for OMNIROUTE_RELAY_BACKEND (same ts | bifrost | auto values). OMNIROUTE_RELAY_BACKEND takes precedence when both are set. |
OMNIROUTE_BIFROST_FAILURE_COOLDOWN_MS |
5000 |
src/app/api/v1/relay/chat/completions/bifrostCooldown.ts |
Cooldown (ms) after a Bifrost sidecar hop fails in auto mode before the relay re-attempts the sidecar; it routes straight to the TS path while the cooldown lasts, then probes again. 0 disables. Only applies when OMNIROUTE_RELAY_BACKEND=auto. |
OMNIROUTE_TLS_CERT |
(unset) | bin/cli/commands/serve.mjs |
Path to a PEM TLS certificate to serve omniroute serve over HTTPS (equivalent to --tls-cert). Must be paired with OMNIROUTE_TLS_KEY; the standalone server then terminates TLS on the same listener (wss:// works unchanged). Unset → plain HTTP. Providing only one of cert/key, or an unreadable path, logs a warning and stays HTTP. |
OMNIROUTE_TLS_KEY |
(unset) | bin/cli/commands/serve.mjs |
Path to the PEM TLS private key for omniroute serve HTTPS (equivalent to --tls-key). Must be paired with OMNIROUTE_TLS_CERT. See OMNIROUTE_TLS_CERT. |
OMNIROUTE_LOCAL_ENDPOINTS_ENABLED |
0 |
src/lib/security/localEndpoints.ts |
Master switch for /api/local/* routes. When unset or 0, all /api/local/* routes return 503 in production. Must be 1 in non-loopback deploys to enable the Redis launcher and similar 1-click local service starters. Belt-and-suspenders with isLocalOnlyPath() route-guard classification (LOCAL_ONLY_API_PREFIXES in src/server/authz/routeGuard.ts). |
OMNIROUTE_LOCAL_ENDPOINTS_TOKEN |
(unset) | src/lib/security/localEndpoints.ts |
Bearer token for /api/local/* callers that aren't on loopback (e.g. the desktop app). When set, requests from non-loopback IPs must carry Authorization: Bearer <token>. Required when OMNIROUTE_LOCAL_ENDPOINTS_ENABLED=1 in non-loopback deployments. |
OMNIROUTE_REDIS_CONTAINER_NAME |
omniroute-redis |
bin/cli/commands/redis.mjs |
Container name for the 1-click Redis launcher (omniroute redis up). Used by both the CLI and the RedisLauncherPanel GUI. |
OMNIROUTE_REDIS_HOST_PORT |
6379 |
bin/cli/commands/redis.mjs |
Host port for the 1-click Redis launcher. Bump if the host already binds 6379. The container's internal port stays 6379. |
OMNIROUTE_REDIS_IMAGE |
redis:7-alpine |
bin/cli/commands/redis.mjs |
Redis image used by the 1-click Redis launcher. Override to redis:8-alpine or a private registry mirror as needed. |
QDRANT_HOST |
qdrant |
(opt-in cluster profile) | Hostname of the Qdrant sidecar when --profile memory is active. Default points to the in-network qdrant service name; override for an external deployment. Only consumed when qdrantEnabled is true in code (src/lib/memory/vectorStore.ts:108). |
QDRANT_PORT |
6333 |
(opt-in cluster profile) | REST port of the Qdrant sidecar. |
QDRANT_GRPC_PORT |
6334 |
(opt-in cluster profile) | gRPC port of the Qdrant sidecar. Used by client libraries that prefer gRPC over REST for streaming ops. |
QDRANT_API_KEY |
(unset) | (opt-in cluster profile) | Optional API key for Qdrant Cloud or an authenticated on-prem instance. Empty → no api-key header sent. |
QDRANT_COLLECTION |
omniroute-memory |
(opt-in cluster profile) | Collection name for OmniRoute's conversation memory embeddings. Created on first run with QDRANT_VECTOR_SIZE dimensions. |
QDRANT_EMBEDDING_MODEL |
text-embedding-3-small |
(opt-in cluster profile) | Default embedding model name recorded in the Qdrant collection metadata. Actual embeddings are generated by whatever provider the embeddingModel field in OmniRoute's settings points to. |
QDRANT_VECTOR_SIZE |
1536 |
(opt-in cluster profile) | Embedding vector dimension. Must match the model you embed with (text-embedding-3-small → 1536; ada-002 → 1536; nomic-embed-text → 768). |
QDRANT_HNSW_EF_CONSTRUCT |
128 |
(opt-in cluster profile) | HNSW index construction-time accuracy. Higher = slower build, faster search. |
OMNIROUTE_ROTATION_ENABLED |
true |
open-sse/services/rotationConfig.ts |
Master switch for operator-configurable account rotation. When false, none of the OMNIROUTE_ROTATE_* classes below trigger account fallback (the master-off state also blocks the default-enabled 429/500/502 classes). Lets a supervising front-end (e.g. the VibeProxy desktop app) mirror its own rotation rules onto the backend's account-fallback engine. |
OMNIROUTE_ROTATION_RATE_LIMIT_RESET_SECONDS |
0 |
open-sse/services/rotationConfig.ts |
Cooldown (seconds) applied to a rate-limited account when the upstream gives no explicit reset hint. 0 = use the engine default cooldown instead of a fixed override. |
OMNIROUTE_ROTATION_DISABLE_TAG_WITHOUT_RESET |
true |
open-sse/services/rotationConfig.ts |
Mirror of the front-end "don't tag as rate-limited without a reset time" preference. |
OMNIROUTE_ROTATE_ON_429 |
true |
open-sse/services/rotationConfig.ts |
Per-status fallback enable for 429 errors. When false (and OMNIROUTE_ROTATION_ENABLED=true), a 429 no longer triggers account rotation and is returned to the client instead. |
OMNIROUTE_ROTATE_429_THRESHOLD |
1 |
open-sse/services/rotationConfig.ts |
Number of 429 errors within OMNIROUTE_ROTATE_429_WINDOW_SECONDS required before the account is rotated. 1 (default) rotates immediately, preserving historical behavior. |
OMNIROUTE_ROTATE_429_WINDOW_SECONDS |
120 |
open-sse/services/rotationConfig.ts |
Sliding window (seconds) over which 429 errors are counted toward OMNIROUTE_ROTATE_429_THRESHOLD. |
OMNIROUTE_ROTATE_ON_500 |
true |
open-sse/services/rotationConfig.ts |
Per-status fallback enable for 5xx server errors (excluding 502, which has its own class). When false, these errors no longer trigger account rotation. |
OMNIROUTE_ROTATE_500_THRESHOLD |
1 |
open-sse/services/rotationConfig.ts |
Number of 5xx errors within OMNIROUTE_ROTATE_500_WINDOW_SECONDS required before the account is rotated. 1 (default) rotates immediately. |
OMNIROUTE_ROTATE_500_WINDOW_SECONDS |
120 |
open-sse/services/rotationConfig.ts |
Sliding window (seconds) over which 5xx errors are counted toward OMNIROUTE_ROTATE_500_THRESHOLD. |
OMNIROUTE_ROTATE_ON_502 |
true |
open-sse/services/rotationConfig.ts |
Per-status fallback enable for 502 (bad gateway) errors. When false, 502s no longer trigger account rotation. |
OMNIROUTE_ROTATE_502_THRESHOLD |
1 |
open-sse/services/rotationConfig.ts |
Number of 502 errors within OMNIROUTE_ROTATE_502_WINDOW_SECONDS required before the account is rotated. 1 (default) rotates immediately. |
OMNIROUTE_ROTATE_502_WINDOW_SECONDS |
120 |
open-sse/services/rotationConfig.ts |
Sliding window (seconds) over which 502 errors are counted toward OMNIROUTE_ROTATE_502_THRESHOLD. |
OMNIROUTE_ROTATE_ON_400 |
false |
open-sse/services/rotationConfig.ts |
Opt-in (default OFF): when true, a plain 400 (bad request) also triggers account rotation. This is additive only — it never blocks the engine's existing behavior where a 400 carrying rate-limit/quota text still falls over regardless of this flag. |
OMNIROUTE_ROTATE_400_THRESHOLD |
1 |
open-sse/services/rotationConfig.ts |
Number of 400 errors within OMNIROUTE_ROTATE_400_WINDOW_SECONDS required before the account is rotated (only consulted when OMNIROUTE_ROTATE_ON_400=true). |
OMNIROUTE_ROTATE_400_WINDOW_SECONDS |
120 |
open-sse/services/rotationConfig.ts |
Sliding window (seconds) over which 400 errors are counted toward OMNIROUTE_ROTATE_400_THRESHOLD. |
26. Test & E2E Harness
Used by scripts/dev/run-next-playwright.mjs, scripts/dev/smoke-electron-packaged.mjs,
scripts/dev/run-ecosystem-tests.mjs, and scripts/build/uninstall.mjs. Leave every
value below unset in production deployments.
| Variable | Default | Source File | Description |
|---|---|---|---|
OMNIROUTE_E2E_BOOTSTRAP_MODE |
auth |
scripts/dev/run-next-playwright.mjs |
E2E bootstrap mode (auth, fresh, reuse) for the Playwright runner. |
OMNIROUTE_E2E_PASSWORD |
falls back to INITIAL_PASSWORD |
scripts/dev/run-next-playwright.mjs |
Admin password injected into the Playwright environment. |
OMNIROUTE_DISABLE_LOCAL_HEALTHCHECK |
true |
scripts/dev/run-next-playwright.mjs |
Disable the local healthcheck poll during Playwright runs. |
OMNIROUTE_DISABLE_TOKEN_HEALTHCHECK |
true |
scripts/dev/run-next-playwright.mjs |
Disable the OAuth token healthcheck loop during tests. |
OMNIROUTE_HEALTHCHECK_SKIP_PROVIDERS |
(unset) | src/lib/tokenHealthCheck.ts |
Comma-separated providers excluded from the proactive token-refresh sweep (e.g. codex,openai). Targeted alternative to fully disabling the healthcheck — short-TTL providers keep refreshing while cascade providers stay reactive-only. |
OMNIROUTE_HIDE_HEALTHCHECK_LOGS |
true |
scripts/dev/run-next-playwright.mjs |
Silence healthcheck noise in Playwright stdout. |
OMNIROUTE_PLAYWRIGHT_SKIP_BUILD |
0 |
scripts/dev/run-next-playwright.mjs |
Skip the Next.js production build before Playwright starts (CI optimization). |
OMNIROUTE_SKIP_UNINSTALL_HOOK |
0 |
scripts/build/uninstall.mjs |
Skip the OmniRoute uninstall hook (used by CI to keep node_modules intact). |
ECOSYSTEM_SERVER_WAIT_MS |
180000 |
scripts/dev/run-ecosystem-tests.mjs |
Wait time (ms) for the server to become healthy before running ecosystem/protocol tests. |
ELECTRON_SMOKE_URL |
http://127.0.0.1:20128/login |
scripts/dev/smoke-electron-packaged.mjs |
URL the Electron smoke harness expects the packaged app to serve. |
ELECTRON_SMOKE_TIMEOUT_MS |
45000 |
scripts/dev/smoke-electron-packaged.mjs |
Total timeout (ms) before the smoke harness gives up. |
ELECTRON_SMOKE_SETTLE_MS |
2000 |
scripts/dev/smoke-electron-packaged.mjs |
Settle window (ms) after the page loads. |
ELECTRON_SMOKE_APP_EXECUTABLE |
(auto) | scripts/dev/smoke-electron-packaged.mjs |
Explicit path to the packaged Electron executable. |
ELECTRON_SMOKE_DATA_DIR |
(tmpdir) | scripts/dev/smoke-electron-packaged.mjs |
Data directory for the Electron smoke run. |
ELECTRON_SMOKE_KEEP_DATA |
0 |
scripts/dev/smoke-electron-packaged.mjs |
Set 1 to preserve the smoke data directory after the run. |
ELECTRON_SMOKE_STREAM_LOGS |
0 |
scripts/dev/smoke-electron-packaged.mjs |
Set 1 to stream Electron logs to stdout during the run. |
CLI_DEVIN_BIN |
(PATH lookup) | open-sse/executors/devin-cli.ts |
Override the Devin CLI binary path. |
Docs translation pipeline
Used by scripts/i18n/run-translation.mjs (the npm run i18n:run command).
All five variables are unset by default — set them in .env only on machines
that should be able to run the docs translator.
| Variable | Default | Source File | Description |
|---|---|---|---|
OMNIROUTE_TRANSLATION_API_URL |
(unset) | scripts/i18n/run-translation.mjs |
OpenAI-compatible base URL for the translation backend. |
OMNIROUTE_TRANSLATION_API_KEY |
(unset) | scripts/i18n/run-translation.mjs |
Bearer token for the translation backend (never logged). |
OMNIROUTE_TRANSLATION_MODEL |
(unset) | scripts/i18n/run-translation.mjs |
Model id, e.g. gpt-4o-mini or cx/gpt-5.4-mini. |
OMNIROUTE_TRANSLATION_TIMEOUT_MS |
60000 |
scripts/i18n/run-translation.mjs |
Per-request timeout in milliseconds. |
OMNIROUTE_TRANSLATION_CONCURRENCY |
4 |
scripts/i18n/run-translation.mjs |
Parallel translation requests when running over multiple files / locales. |
Audit: Removed / Dead Variables
The following variables appeared in previous versions of .env.example but have no runtime references in the current codebase. They have been removed:
| Variable | Reason |
|---|---|
STORAGE_DRIVER=sqlite |
Never read by any source file. SQLite is the only supported driver — no selection needed. |
INSTANCE_NAME=omniroute |
Present in old docs/env templates but unused at runtime. May return in a future multi-instance feature. |
SQLITE_MAX_SIZE_MB=2048 |
Not referenced in source code. Database size is not artificially limited. |
SQLITE_CLEAN_LEGACY_FILES=true |
Not referenced in source code. Legacy cleanup was likely removed. |
CLI_ROO_BIN |
Not registered in src/shared/services/cliRuntime.ts. |
CLI_KIMI_CODING_BIN |
Not registered in src/shared/services/cliRuntime.ts (Kimi Coding uses OAuth, not a CLI binary). |
IFLOW_OAUTH_CLIENT_ID / IFLOW_OAUTH_CLIENT_SECRET |
Not referenced anywhere in source code. |
CEREBRAS_API_KEY / COHERE_API_KEY / FIREWORKS_API_KEY / GROQ_API_KEY / MISTRAL_API_KEY / NEBIUS_API_KEY / PERPLEXITY_API_KEY / TOGETHER_API_KEY / XAI_API_KEY |
Removed in v3.8.0. The runtime no longer reads these env vars — credentials come from Dashboard / data/provider-credentials.json / encrypted DB. |
CURSOR_PROTOBUF_DEBUG |
Removed in v3.8.0. Cursor executor uses CURSOR_DEBUG / CURSOR_STREAM_DEBUG (see §22). |
CLI_COMPAT_KIRO |
Removed in v3.8.0. Kiro is in CLI_COMPAT_OMITTED_PROVIDER_IDS — its toggle has no effect. |
QIANFAN_API_KEY |
Removed alongside other unused provider API key stubs in v3.8.0. |
Default Value Corrections
| Variable | Old .env.example Value |
Actual Code Default | Fixed |
|---|---|---|---|
APP_LOG_RETENTION_DAYS |
90 |
7 |
✅ Removed misleading value; documented 7 as default |
CALL_LOG_RETENTION_DAYS |
90 |
7 |
✅ Removed misleading value; documented 7 as default |
OpenCode config regeneration (ad-hoc tooling)
Used by scripts/ad-hoc/regen-opencode-config.ts to regenerate an opencode.json
with accurate limit.context and limit.output values pulled from the running
OmniRoute instance. None of these are required for normal operation — the script
is developer tooling only.
| Variable | Default | Source File | Description |
|---|---|---|---|
OMNIROUTE_URL |
http://localhost:20128 |
scripts/ad-hoc/regen-opencode-config.ts |
Base URL of the OmniRoute instance to query for /v1/models. |
OMNIROUTE_KEY |
(unset) | scripts/ad-hoc/regen-opencode-config.ts |
API key to authenticate against the OmniRoute /v1/models endpoint. Falls back to OPENCODE_API_KEY when unset. |
OPENCODE_API_KEY |
(unset) | scripts/ad-hoc/regen-opencode-config.ts |
OpenCode-style API key (sk-...) written into the regenerated opencode.json. Falls back to OMNIROUTE_KEY when unset. |
Compression offline-eval harness (ad-hoc tooling)
Used by scripts/compression-eval/index.ts, the offline compression evaluation CLI.
Not required for normal operation — developer tooling only.
| Variable | Default | Source File | Description |
|---|---|---|---|
OMNIROUTE_EVAL_CREDENTIALS |
{} (empty) |
scripts/compression-eval/index.ts |
Operator-supplied JSON credentials for the provider exercised by the offline compression-eval CLI (parsed with JSON.parse). Leave unset for a dry run. |