mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-22 23:22:09 +03:00
feat(routing): add DISABLE_CONTEXT_WINDOW_CHECKS bypass for the direct-request input/context check (#10927)
Rescoped from #10606 — see PR body for the full rationale (combo-routing half made moot by #10162's advisory-only architecture, chatCore.ts hard-reject bypass retains real value). Validated in an isolated worktree boarded onto origin/release/v3.8.50: - 65/65 focused unit tests pass (chatcore-model-output-cap-wiring + feature-flags-settings). - check-file-size, check-changelog-integrity: OK. - typecheck:core: clean. - check-complexity / check-cognitive-complexity: OK, both under baseline. Co-authored-by: JxnLexn <10897478+JxnLexn@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
118840131d
commit
f71f3da08b
@@ -12716,6 +12716,10 @@
|
||||
"ALLOW_MULTI_CONNECTIONS_PER_COMPAT_NODE": {
|
||||
"description": "Mehrere Verbindungen für jeden Kompatibilitätsknoten zulassen."
|
||||
},
|
||||
"DISABLE_CONTEXT_WINDOW_CHECKS": {
|
||||
"label": "Kontextfensterprüfungen deaktivieren",
|
||||
"description": "Lokale Kontextfenster- und Maximaleingabetoken-Prüfung von OmniRoute für direkte Einzelmodell-Anfragen überspringen. Upstream-Anbieter erzwingen weiterhin ihre tatsächlichen Grenzen. Prompt-Komprimierung und Ausgabetoken-Grenzen bleiben aktiv."
|
||||
},
|
||||
"RESPONSES_PASSTHROUGH_DROP_COMMENTARY": {
|
||||
"description": "Interne Ausgabeelemente der Kommentarphase aus den Passthrough-Streams der Responses-API entfernen, bevor sie an Clients weitergeleitet werden. Deaktivieren Sie dieses Flag, um rohe Upstream-Kommentare zu erhalten."
|
||||
},
|
||||
@@ -13356,6 +13360,7 @@
|
||||
}
|
||||
},
|
||||
"featureFlagCapabilityFilterEnabledDescription": "Lehnen Sie Anfragen ab, bevor sie versendet werden, wenn das Zielmodell über die erforderlichen Funktionen (Vision, Werkzeuge, strukturierte Ausgabe, Kontextfenster) nicht verfügt. Schützt direkte Einzelanbieteranfragen, die den Kombo-Schicht-Kompatibilitätsfilter umgehen.",
|
||||
"featureFlagDisableContextWindowChecksDescription": "Lokale Kontextfenster- und Maximaleingabetoken-Prüfung von OmniRoute für direkte Einzelmodell-Anfragen überspringen. Upstream-Anbieter erzwingen weiterhin ihre tatsächlichen Grenzen. Prompt-Komprimierung und Ausgabetoken-Grenzen bleiben aktiv.",
|
||||
"publicSystem": {
|
||||
"notFound": {
|
||||
"title": "Seite nicht gefunden",
|
||||
|
||||
@@ -12754,6 +12754,10 @@
|
||||
"ALLOW_MULTI_CONNECTIONS_PER_COMPAT_NODE": {
|
||||
"description": "Allow multiple connections for each compatibility node."
|
||||
},
|
||||
"DISABLE_CONTEXT_WINDOW_CHECKS": {
|
||||
"label": "Disable Context Window Checks",
|
||||
"description": "Skip OmniRoute's local context-window and max-input-token check for direct single-model requests. Upstream providers still enforce their actual limits. Prompt compression and output-token caps remain active."
|
||||
},
|
||||
"RESPONSES_PASSTHROUGH_DROP_COMMENTARY": {
|
||||
"description": "Remove internal commentary-phase output items from Responses API passthrough streams before forwarding them to clients. Disable this flag to receive raw upstream commentary."
|
||||
},
|
||||
@@ -13394,6 +13398,7 @@
|
||||
}
|
||||
},
|
||||
"featureFlagCapabilityFilterEnabledDescription": "Reject requests before dispatch when the target model lacks required capabilities (vision, tools, structured output, context window). Protects direct single-provider requests that bypass the combo-layer compatibility filter.",
|
||||
"featureFlagDisableContextWindowChecksDescription": "Skip OmniRoute's local context-window and max-input-token check for direct single-model requests. Upstream providers still enforce their actual limits. Prompt compression and output-token caps remain active.",
|
||||
"publicSystem": {
|
||||
"notFound": {
|
||||
"title": "Page not found",
|
||||
|
||||
@@ -12747,6 +12747,10 @@
|
||||
"ALLOW_MULTI_CONNECTIONS_PER_COMPAT_NODE": {
|
||||
"description": "Permite múltiplas conexões para cada nó de compatibilidade."
|
||||
},
|
||||
"DISABLE_CONTEXT_WINDOW_CHECKS": {
|
||||
"label": "Desativar verificações da janela de contexto",
|
||||
"description": "Ignora a verificação local do OmniRoute para janela de contexto e limite máximo de tokens de entrada em solicitações diretas a um único modelo. Os provedores upstream continuam aplicando seus limites reais. A compactação de prompts e os limites de tokens de saída permanecem ativos."
|
||||
},
|
||||
"RESPONSES_PASSTHROUGH_DROP_COMMENTARY": {
|
||||
"description": "Remove itens de saída da fase de comentário interno dos streams de passthrough da Responses API antes de encaminhá-los aos clientes. Desative esta flag para receber o comentário bruto do upstream."
|
||||
},
|
||||
@@ -13387,6 +13391,7 @@
|
||||
}
|
||||
},
|
||||
"featureFlagCapabilityFilterEnabledDescription": "Rejeitar requisições antes do despacho quando o modelo alvo nao possui as capacidades necessarias (visao, ferramentas, saída estruturada, janela de contexto). Protege requisições diretas que ignoram o filtro de compatibilidade do combo.",
|
||||
"featureFlagDisableContextWindowChecksDescription": "Ignora a verificação local do OmniRoute para janela de contexto e limite máximo de tokens de entrada em solicitações diretas a um único modelo. Os provedores upstream continuam aplicando seus limites reais. A compactação de prompts e os limites de tokens de saída permanecem ativos.",
|
||||
"publicSystem": {
|
||||
"notFound": {
|
||||
"title": "Página não encontrada",
|
||||
|
||||
@@ -12755,6 +12755,10 @@
|
||||
"ALLOW_MULTI_CONNECTIONS_PER_COMPAT_NODE": {
|
||||
"description": "Cho phép nhiều kết nối trên mỗi node tương thích."
|
||||
},
|
||||
"DISABLE_CONTEXT_WINDOW_CHECKS": {
|
||||
"label": "Tắt kiểm tra cửa sổ ngữ cảnh",
|
||||
"description": "Bỏ qua kiểm tra cục bộ của OmniRoute về cửa sổ ngữ cảnh và giới hạn token đầu vào tối đa cho yêu cầu trực tiếp đến một mô hình đơn lẻ. Nhà cung cấp thượng nguồn vẫn áp dụng các giới hạn thực tế. Tính năng nén prompt và giới hạn token đầu ra vẫn hoạt động."
|
||||
},
|
||||
"RESPONSES_PASSTHROUGH_DROP_COMMENTARY": {
|
||||
"description": "Loại các mục đầu ra thuộc giai đoạn commentary nội bộ khỏi luồng chuyển tiếp Responses API trước khi gửi tới ứng dụng khách. Tắt cờ này để nhận nguyên dữ liệu commentary từ thượng nguồn."
|
||||
},
|
||||
@@ -13395,6 +13399,7 @@
|
||||
}
|
||||
},
|
||||
"featureFlagCapabilityFilterEnabledDescription": "Từ chối yêu cầu trước khi gửi đi khi mô hình đích thiếu các khả năng bắt buộc (thị giác, công cụ, đầu ra có cấu trúc, cửa sổ ngữ cảnh). Bảo vệ các yêu cầu trực tiếp đến một nhà cung cấp khi chúng bỏ qua bộ lọc tương thích của combo.",
|
||||
"featureFlagDisableContextWindowChecksDescription": "Bỏ qua kiểm tra cục bộ của OmniRoute về cửa sổ ngữ cảnh và giới hạn token đầu vào tối đa cho yêu cầu trực tiếp đến một mô hình đơn lẻ. Nhà cung cấp thượng nguồn vẫn áp dụng các giới hạn thực tế. Tính năng nén prompt và giới hạn token đầu ra vẫn hoạt động.",
|
||||
"publicSystem": {
|
||||
"notFound": {
|
||||
"title": "Không tìm thấy trang",
|
||||
|
||||
@@ -236,7 +236,7 @@ export const FEATURE_FLAG_DEFINITIONS: FeatureFlagDefinition[] = [
|
||||
warningLevel: "info",
|
||||
},
|
||||
|
||||
// ──────────────── Policies (4) ────────────────
|
||||
// ──────────────── Policies (5) ────────────────
|
||||
{
|
||||
key: "TOOL_POLICY_MODE",
|
||||
label: "Tool Policy Mode",
|
||||
@@ -271,6 +271,18 @@ export const FEATURE_FLAG_DEFINITIONS: FeatureFlagDefinition[] = [
|
||||
requiresRestart: true,
|
||||
warningLevel: "info",
|
||||
},
|
||||
{
|
||||
key: "DISABLE_CONTEXT_WINDOW_CHECKS",
|
||||
label: "Disable Context Window Checks",
|
||||
description:
|
||||
"Skip OmniRoute's local context-window and max-input-token check for direct single-model requests. Upstream providers remain responsible for enforcing their actual limits. Off by default.",
|
||||
descriptionI18nKey: "featureFlagDisableContextWindowChecksDescription",
|
||||
category: "policies",
|
||||
defaultValue: "false",
|
||||
type: "boolean",
|
||||
requiresRestart: false,
|
||||
warningLevel: "danger",
|
||||
},
|
||||
{
|
||||
key: "CAPABILITY_FILTER_ENABLED",
|
||||
label: "Capability Filter",
|
||||
|
||||
@@ -72,6 +72,22 @@ export function isCcCompatibleProviderEnabled(): boolean {
|
||||
return isFeatureFlagEnabled("ENABLE_CC_COMPATIBLE_PROVIDER");
|
||||
}
|
||||
|
||||
/**
|
||||
* Context-window checks are fail-safe: an unavailable flag store must never
|
||||
* silently disable local request bounds.
|
||||
*/
|
||||
export function areContextWindowChecksDisabled(): boolean {
|
||||
try {
|
||||
return isFeatureFlagEnabled("DISABLE_CONTEXT_WINDOW_CHECKS");
|
||||
} catch (error) {
|
||||
console.error(
|
||||
"[featureFlags] Failed to resolve DISABLE_CONTEXT_WINDOW_CHECKS, keeping checks enabled:",
|
||||
error instanceof Error ? error.message : error
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export function isApiKeyRevealEnabledFlag(): boolean {
|
||||
try {
|
||||
return isFeatureFlagEnabled("ALLOW_API_KEY_REVEAL");
|
||||
|
||||
Reference in New Issue
Block a user