Skip to content

feat(routing): add DISABLE_CONTEXT_WINDOW_CHECKS bypass for the direct-request input/context check - #10927

Merged
diegosouzapw merged 1 commit into
release/v3.8.50from
fix/10606-disable-context-window-checks
Aug 21, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.50from
fix/10606-disable-context-window-checks

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Summary

Rescoped from #10606. Adds the default-off DISABLE_CONTEXT_WINDOW_CHECKS feature flag so operators can bypass OmniRoute's local context-window / max-input-token check (enforceOutputTokenBudget in chatCore.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 deleted knownContextOverflow.ts and made combo-routing context checks advisory-only — never a hard reject — making that half of #10606 moot. This PR keeps only the surviving chatCore.ts hard-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: new DISABLE_CONTEXT_WINDOW_CHECKS policy 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, enforceOutputTokenBudget is 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: 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

…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>
@diegosouzapw
diegosouzapw merged commit f71f3da into release/v3.8.50 Aug 21, 2026
8 of 12 checks passed
@diegosouzapw
diegosouzapw deleted the fix/10606-disable-context-window-checks branch August 21, 2026 15:32
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants