From e185362f8f3c19a81917ee43f2b81ab42a16bec3 Mon Sep 17 00:00:00 2001 From: Tin Chi Lo Date: Mon, 3 Aug 2026 17:23:33 -0700 Subject: [PATCH] fix(ui): add session_affinity to bundled presets after staging rebase Rebased onto litellm_internal_staging, which landed session_affinity as a required ComplexityRouterConfigPayload field (#35714) after this branch forked. Add it to both bundled presets so the type cast in autorouter_presets.ts holds, and drive the two new session-affinity tests through the Custom template path so they clear the template-required check added earlier in this PR. --- ui/litellm-dashboard/src/autorouter_presets.json | 6 ++++-- .../src/components/add_model/add_auto_router_tab.test.tsx | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/litellm-dashboard/src/autorouter_presets.json b/ui/litellm-dashboard/src/autorouter_presets.json index ec9cfe1eac4..2603d7f5324 100644 --- a/ui/litellm-dashboard/src/autorouter_presets.json +++ b/ui/litellm-dashboard/src/autorouter_presets.json @@ -10,7 +10,8 @@ "REASONING": ["claude-opus-5"] }, "classifier_type": "heuristic", - "escalation_keywords": ["LITELLM ESCALATE"] + "escalation_keywords": ["LITELLM ESCALATE"], + "session_affinity": false } }, "openai_family": { @@ -24,7 +25,8 @@ "REASONING": ["o3"] }, "classifier_type": "heuristic", - "escalation_keywords": ["LITELLM ESCALATE"] + "escalation_keywords": ["LITELLM ESCALATE"], + "session_affinity": false } } } diff --git a/ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx b/ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx index 5ea9e9de3fd..efb46736ea5 100644 --- a/ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx +++ b/ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx @@ -387,6 +387,8 @@ describe("AddAutoRouterTab", () => { renderWithProviders(); + openTemplateDropdown(); + fireEvent.click(optionByLabel("Custom Configuration")!); await user.type(screen.getByPlaceholderText(/smart_router/i), "affinity-router"); await user.click(screen.getByText("Advanced: Session Affinity")); expect(await screen.findByRole("switch", { name: "Pin a session to its first model" })).not.toBeChecked(); @@ -405,6 +407,8 @@ describe("AddAutoRouterTab", () => { renderWithProviders(); + openTemplateDropdown(); + fireEvent.click(optionByLabel("Custom Configuration")!); await user.type(screen.getByPlaceholderText(/smart_router/i), "affinity-router"); await user.click(screen.getByText("Advanced: Session Affinity")); await user.click(await screen.findByRole("switch", { name: "Pin a session to its first model" }));