Repository navigation
feat(routing): add DISABLE_CONTEXT_WINDOW_CHECKS bypass for the direct-request input/context check - #10927
Merged
diegosouzapw merged 1 commit intoAug 21, 2026
Conversation
…t-request input/context check Adds the default-off DISABLE_CONTEXT_WINDOW_CHECKS feature flag to let operators bypass OmniRoute's local context-window / max-input-token check (enforceOutputTokenBudget in chatCore.ts) for direct single-model requests, leaving upstream limits, prompt compression, and the model's own output-token cap active. Exposed via the dashboard feature-flag registry with localized labels/descriptions (de/en/pt-BR/vi). Rescoped from #10606: that PR also touched the combo-routing context filter (knownContextOverflow.ts / resolveAutoStrategy.ts / comboStructure.ts), but #10162 (merged earlier the same day, RFC #10141) already deleted that file and made combo-routing context checks advisory-only — never a hard reject. This PR keeps only the surviving chatCore.ts hard-reject bypass, which #10162 did not touch and which still has real value. Co-authored-by: JxnLexn <10897478+JxnLexn@users.noreply.github.com>
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…t-request input/context check (diegosouzapw#10927) Rescoped from diegosouzapw#10606 — see PR body for the full rationale (combo-routing half made moot by diegosouzapw#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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rescoped from #10606. Adds the default-off
DISABLE_CONTEXT_WINDOW_CHECKSfeature flag so operators can bypass OmniRoute's local context-window / max-input-token check (enforceOutputTokenBudgetinchatCore.ts) for direct single-model requests. Upstream providers remain responsible for enforcing their real limits; prompt compression and the model's own output-token cap stay active.Why rescoped
#10606 also touched the combo-routing context filter (
knownContextOverflow.ts,resolveAutoStrategy.ts,comboStructure.ts,capabilityFilter.ts). #10162 (merged the same day, per owner RFC #10141) already deletedknownContextOverflow.tsand made combo-routing context checks advisory-only — never a hard reject — making that half of #10606 moot. This PR keeps only the survivingchatCore.tshard-reject bypass, which #10162 did not touch and which still has real value: it's the only remaining local mechanism that can reject a direct request purely on estimated context/input-token size.Changes
src/shared/constants/featureFlagDefinitions.ts: newDISABLE_CONTEXT_WINDOW_CHECKSpolicy flag (danger warning level, default off).src/shared/utils/featureFlags.ts:areContextWindowChecksDisabled()helper, fail-safe (keeps checks enabled if the flag store is unreadable).open-sse/handlers/chatCore.ts: when the flag is enabled,enforceOutputTokenBudgetis called with an unbounded context limit and no input-token cap — the model's own output-token cap (modelOutputCap) stays enforced..env.example,docs/reference/ENVIRONMENT.md,docs/reference/FEATURE_FLAGS.md: document the new flag.src/i18n/messages/{de,en,pt-BR,vi}.json: localized label/description.changelog.d/features/disable-context-window-checks.md.tests/unit/chatcore-model-output-cap-wiring.test.ts(+2),tests/unit/feature-flags-settings.test.ts(+3) — bypass behavior, output-cap still enforced, fail-safe on unreadable flag store, flag-definition shape.Validation
Run in an isolated worktree boarded onto
origin/release/v3.8.50:node --import tsx/esm --test tests/unit/chatcore-model-output-cap-wiring.test.ts tests/unit/feature-flags-settings.test.ts— 65/65 pass.node scripts/check/check-file-size.mjs,check-changelog-integrity.mjs— OK.npm run typecheck:core— clean.node scripts/check/check-complexity.mjs,check-cognitive-complexity.mjs— OK, both under baseline.Co-authored-by: JxnLexn 10897478+JxnLexn@users.noreply.github.com