From ddee064f1b3c3832bdd3bdd4cd36c8d1ac046f8c Mon Sep 17 00:00:00 2001 From: Jacob Stoner Date: Mon, 24 Aug 2026 13:16:04 -0400 Subject: [PATCH] fix(sse): preserve auto scoring order (#11400) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Validado em lote combinado (batch-0824f, junto de #11399/#11402/#11407) 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/combo-task-aware.test.ts). Remove `auto` da lista de estratégias task-routing genéricas — coerente com o #11399, que também protege a ordem já computada pelo `auto` contra reordenação por outro pós-processamento. Obrigado pela contribuição! --- open-sse/services/taskAwareRouting.ts | 2 +- tests/unit/combo-task-aware.test.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/open-sse/services/taskAwareRouting.ts b/open-sse/services/taskAwareRouting.ts index 3cc2da730c..93b44efec8 100644 --- a/open-sse/services/taskAwareRouting.ts +++ b/open-sse/services/taskAwareRouting.ts @@ -64,7 +64,7 @@ const MAX_CONVERSATION_AFFINITY_ENTRIES = 1000; * Task routing is additive: other strategies are wholly unaffected. */ export function isTaskRoutingStrategy(strategy: unknown): boolean { - return ["smart", "task", "task-aware", "task_aware", "auto"].includes( + return ["smart", "task", "task-aware", "task_aware"].includes( String(strategy ?? "").toLowerCase() ); } diff --git a/tests/unit/combo-task-aware.test.ts b/tests/unit/combo-task-aware.test.ts index b8a9887c7b..7e056d456e 100644 --- a/tests/unit/combo-task-aware.test.ts +++ b/tests/unit/combo-task-aware.test.ts @@ -255,9 +255,10 @@ describe("reorderByTaskWeight", () => { describe("isTaskRoutingStrategy", () => { it("returns true for task-aware strategy names", () => { - for (const name of ["smart", "task", "task-aware", "task_aware", "auto"]) { + for (const name of ["smart", "task", "task-aware", "task_aware"]) { assert.ok(isTaskRoutingStrategy(name), `Expected ${name} to be task-routing`); } + assert.ok(!isTaskRoutingStrategy("auto"), "auto scoring must not be reordered by task routing"); }); it("is case-insensitive", () => {