Skip to content

fix(dashboard): honor active compression profile in effective-pipeline preview (#12063) - #13287

Merged
diegosouzapw merged 1 commit into
release/v3.8.51from
fix/12063-compression-profile-header
Sep 12, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.51from
fix/12063-compression-profile-header

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Closes #12063

Root cause

The Settings-page "Effective pipeline" preview (CompressionPanel.tsx) was computed as
deriveDefaultPlan(config.engines, config.enabled), which only looks at the master switch and
the per-engine toggle grid — it never consults config.activeComboId. The real per-request
resolver (resolveBasePlan in open-sse/services/compression/strategySelector.ts) gives an
active named profile precedence over the plain engines-derived default. So whenever an
operator picked a named profile on the Combos page but hadn't also flipped an individual engine
toggle on the Settings page, the preview showed "off" while a live request actually ran the
active profile's stacked pipeline — the reported disconnect between the UI and the
x-omniroute-compression response header.

Separately, the Combos page already fetches settings.enabled (the master switch) but never
surfaced it: a profile could show as "active" while the master switch (default off on a fresh
install) hard-kills all compression before activeComboId is even read.

Fix

  • Added deriveEffectivePreviewPlan(config, combos)
    (open-sse/services/compression/deriveEffectivePreviewPlan.ts), a pure helper for STATIC
    preview surfaces that mirrors resolveBasePlan's precedence for the layers that apply
    at rest (master switch → active profile → engines-map default), skipping the
    request-scoped layers (header, routing override, auto-trigger) that need live-request
    context a static preview doesn't have.
  • CompressionPanel.tsx now fetches the named-combo map (/api/context/combos) and uses
    deriveEffectivePreviewPlan instead of the bare deriveDefaultPlan call, so "Effective
    pipeline" always matches what a live request would actually run.
  • CompressionCombosPageClient.tsx now renders a visible warning banner (new i18n keys
    contextCombos.activeProfileMasterSwitchOffWarning / ...Cta) when an active profile is
    selected but the master switch is off, linking to the Settings page.
  • resolveBasePlan/selectCompressionPlan (the actual request-time precedence) are
    untouched — this is a display/UX-only fix, confirmed by the full pre-existing
    strategySelector/deriveDefaultPlan/active-combo test suite passing unchanged (65 tests).

Regression test

tests/unit/compression/derive-effective-preview-plan.test.ts — extends the plan-file's proven
RED repro into a permanent guard (master-off, active-profile-resolves, unresolved-profile
fallback, no-active-profile parity with deriveDefaultPlan).

The original repro (documented in the analysis plan-file, re-verified here) was RED against the
prior code:

✖ issue #12063: Settings-page preview must match the real runtime plan when a profile is active
  AssertionError [ERR_ASSERTION]: ... 'off' !== 'stacked'

GREEN after the fix:

node --import tsx/esm --test tests/unit/compression/derive-effective-preview-plan.test.ts
✔ issue #12063: preview matches the real runtime plan when a profile is active
✔ master switch off => off, regardless of an active profile
✔ activeComboId set but unresolved in combos => falls back to the engines map
✔ no active profile => matches deriveDefaultPlan(engines, enabled) exactly
ℹ tests 4 / pass 4 / fail 0

Gates run (all green)

  • node scripts/check/check-file-size.mjs — OK, no new frozen violations
  • node scripts/check/check-complexity.mjs — OK (2798 violations, baseline 3218)
  • node scripts/check/check-cognitive-complexity.mjs — OK (1265 violations, baseline 1437)
  • npm run typecheck:core — exit 0
  • npm run typecheck:noimplicit:core — exit 0
  • npm run check:dashboard-typecheck — OK, 206 pre-existing errors all within frozen baseline
    (none in touched files)
  • npx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files> —
    exit 0
  • node scripts/check/check-t11-any-budget.mjs — PASS
  • node scripts/check/check-tracked-artifacts.mjs — OK
  • node scripts/check/check-changelog-integrity.mjs — OK
  • npm run i18n:check-ui-coverage — PASS, all 50 locales ≥80% (the two new i18n keys were added
    as __MISSING__: placeholders to all non-English locales — a scoped, ad-hoc insertion
    (scripts/ad-hoc/add-12063-i18n-keys.mjs) rather than the full i18n:sync-ui, so the diff
    touches only these 2 keys per locale and does not also backfill ~1000 unrelated pre-existing
    missing keys)
  • node --import tsx/esm --test tests/unit/compression/derive-default-plan.test.ts tests/unit/compression/derive-effective-preview-plan.test.ts — 8/8 pass
  • Full pre-existing compression-precedence suite (strategySelector.test.ts,
    active-combo-dispatch.test.ts, active-combo-integration.test.ts,
    derived-pipeline-integration.test.ts, compression-header-dispatch.test.ts,
    adaptive-select-plan-wiring.test.ts, adaptive-chatcore-source-guard.test.ts) — 65/65 pass
    unchanged, confirming request-time precedence was not touched
  • npx vitest run tests/unit/ui/compressionPanel.test.tsx — 4/4 pass unchanged

⚠️ base-red inherited: #12732 — unit #12058, integration codex-cache, package-artifact,
tarball-smoke, agent-skills-sync

…e preview (#12063)

The Settings-page 'Effective pipeline' preview was computed as
deriveDefaultPlan(config.engines, config.enabled), which never consulted
config.activeComboId, while the real per-request resolver (resolveBasePlan)
gives an active named profile precedence over the plain engines-derived
default. This made the dashboard preview disagree with what a live request
actually does.

Add deriveEffectivePreviewPlan(config, combos), a pure static-preview helper
that mirrors resolveBasePlan's precedence for the layers that apply to an
at-rest preview (master switch, then active profile, else the engines map),
and wire it into CompressionPanel. Also surface a warning banner on the
Combos page when an active profile is selected but the master switch is
off, since that combination silently no-ops at request time.
@diegosouzapw
diegosouzapw merged commit 39abab6 into release/v3.8.51 Sep 12, 2026
15 of 21 checks passed
Githab-capibara added a commit to Githab-capibara/OmniRoute that referenced this pull request Sep 17, 2026
…e preview (cheaper-inference#12063) (cheaper-inference#13287)

Merged as part of the 39-PR owner batch of 2026-09-11, validated as a unit.

Boarded into one consolidated worktree cut from `release/v3.8.51` with the other 38 — zero conflicts between them.

- ESLint over every changed file: no errors (the only finding was one suppression entry the batch emptied, pruned on cheaper-inference#13243)
- `typecheck:core` clean; `check:dashboard-typecheck` OK (206 pre-existing, within baseline); `check:changelog-integrity` OK
- complexity 2821 / baseline 3218 and cognitive-complexity 1272 / baseline 1437 — both under baseline
- 256 assertions green: 246 under node:test and 10 under vitest, which is where `tests/unit/**/*.test.tsx` actually runs
- `check-file-size`: `chatCore.ts` rebaselined 6144 → 6146 for cheaper-inference#13278 and cheaper-inference#13276, annotated and landed on cheaper-inference#13243

⚠️ base-red inherited: cheaper-inference#12732 — the provider count (356 in the docs vs the 358 the modules define) and `open-sse/utils/stream.ts` at 3115 > frozen 3098 both reproduce on the pure tip with zero contribution from this batch.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…e preview (cheaper-inference#12063) (cheaper-inference#13287)

Merged as part of the 39-PR owner batch of 2026-09-11, validated as a unit.

Boarded into one consolidated worktree cut from `release/v3.8.51` with the other 38 — zero conflicts between them.

- ESLint over every changed file: no errors (the only finding was one suppression entry the batch emptied, pruned on cheaper-inference#13243)
- `typecheck:core` clean; `check:dashboard-typecheck` OK (206 pre-existing, within baseline); `check:changelog-integrity` OK
- complexity 2821 / baseline 3218 and cognitive-complexity 1272 / baseline 1437 — both under baseline
- 256 assertions green: 246 under node:test and 10 under vitest, which is where `tests/unit/**/*.test.tsx` actually runs
- `check-file-size`: `chatCore.ts` rebaselined 6144 → 6146 for cheaper-inference#13278 and cheaper-inference#13276, annotated and landed on cheaper-inference#13243

⚠️ base-red inherited: cheaper-inference#12732 — the provider count (356 in the docs vs the 358 the modules define) and `open-sse/utils/stream.ts` at 3115 > frozen 3098 both reproduce on the pure tip with zero contribution from this batch.
@diegosouzapw
diegosouzapw deleted the fix/12063-compression-profile-header branch October 18, 2026 23:48
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.

fix(backend): active compression profile shown in UI but response header reports compression off

1 participant