From 56d64e29a41d12378a6252d2555d466bf6d6da15 Mon Sep 17 00:00:00 2001 From: Jacob Stoner Date: Mon, 24 Aug 2026 13:16:37 -0400 Subject: [PATCH] fix(dashboard): expose custom mode-pack option (#11407) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Validado em lote combinado (batch-0824f, junto de #11399/#11400/#11402) contra o tip de release/v3.8.50: typecheck:core limpo, file-size/changelog/complexity/cognitive-complexity OK, 56/56 testes focados passando incluindo os deste PR (tests/unit/autocombo-unification.test.ts). Baixo risco: expõe a opção "custom" já suportada em runtime (`getModePack("custom") === undefined`, cai de volta para os pesos explícitos dos sliders) no seletor compartilhado de mode-pack da UI. Obrigado pela contribuição! --- src/lib/combos/intelligentRouting.ts | 1 + tests/unit/autocombo-unification.test.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/lib/combos/intelligentRouting.ts b/src/lib/combos/intelligentRouting.ts index 976e13e047..4fa6c86b84 100644 --- a/src/lib/combos/intelligentRouting.ts +++ b/src/lib/combos/intelligentRouting.ts @@ -58,6 +58,7 @@ export const DEFAULT_INTELLIGENT_WEIGHTS: IntelligentRoutingWeights = { }; export const MODE_PACK_OPTIONS = [ + { id: "custom", label: "Custom / None (Use Sliders)", emoji: "tune" }, { id: "ship-fast", label: "Ship Fast", emoji: "rocket_launch" }, { id: "cost-saver", label: "Cost Saver", emoji: "savings" }, { id: "quality-first", label: "Quality First", emoji: "target" }, diff --git a/tests/unit/autocombo-unification.test.ts b/tests/unit/autocombo-unification.test.ts index ebbafe62bb..1ead4afc9f 100644 --- a/tests/unit/autocombo-unification.test.ts +++ b/tests/unit/autocombo-unification.test.ts @@ -2,6 +2,7 @@ import test from "node:test"; import assert from "node:assert/strict"; const intelligentRouting = await import("../../src/lib/combos/intelligentRouting.ts"); +const { getModePack } = await import("../../open-sse/services/autoCombo/modePacks.ts"); test("getStrategyCategory classifies intelligent and deterministic strategies correctly", () => { assert.equal(intelligentRouting.getStrategyCategory("auto"), "intelligent"); @@ -155,6 +156,19 @@ test("sidebar visibility excludes the removed auto-combo item", async () => { ]); }); +test("custom mode-pack selection preserves explicit slider intent", () => { + assert.deepEqual(intelligentRouting.MODE_PACK_OPTIONS[0], { + id: "custom", + label: "Custom / None (Use Sliders)", + emoji: "tune", + }); + assert.equal( + intelligentRouting.normalizeIntelligentRoutingConfig({ modePack: "custom" }).modePack, + "custom" + ); + assert.equal(getModePack("custom"), undefined); +}); + test("intelligent routing helpers normalize config and build provider scores", () => { const normalizedConfig = intelligentRouting.normalizeIntelligentRoutingConfig({ candidatePool: ["openai", "anthropic"],