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.
This commit is contained in:
Tin Chi Lo 2026-08-03 17:23:33 -07:00
parent b12931a84c
commit e185362f8f
2 changed files with 8 additions and 2 deletions

View file

@ -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
}
}
}

View file

@ -387,6 +387,8 @@ describe("AddAutoRouterTab", () => {
renderWithProviders(<Harness />);
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(<Harness />);
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" }));