From da80de784849f29ab06c9964aa9711637e89caab Mon Sep 17 00:00:00 2001 From: Tin Chi Lo Date: Wed, 26 Aug 2026 23:36:28 -0700 Subject: [PATCH] refactor(ui): name the auto-router prompt control Edit prompt and say it takes examples The control is the one place an edited tier set writes calibration examples, so the label and the line under it now say that rather than describing the text as opening instructions. The label is fixed instead of switching on whether a prompt is set, since the Reset to default link beside it already carries that. --- .../src/components/add_model/ClassificationPromptEditor.tsx | 6 +++--- .../components/add_model/ComplexityRouterConfig.test.tsx | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ui/litellm-dashboard/src/components/add_model/ClassificationPromptEditor.tsx b/ui/litellm-dashboard/src/components/add_model/ClassificationPromptEditor.tsx index 1840eaea13c..66433ce23de 100644 --- a/ui/litellm-dashboard/src/components/add_model/ClassificationPromptEditor.tsx +++ b/ui/litellm-dashboard/src/components/add_model/ClassificationPromptEditor.tsx @@ -42,7 +42,7 @@ const ClassificationPromptEditor: React.FC = ({
{isOverridden && (

{isOverridden - ? "This router opens its classifier prompt with your own instructions." - : "Replace the opening instructions, and write calibration examples of your own. Your tier definitions and the injection guard are always appended below them."} + ? "This router opens with your own instructions and calibration examples. Your tier definitions and the injection guard are still appended below them." + : "Write the opening instructions and your own calibration examples. Your tier definitions and the injection guard are always appended below them."}

diff --git a/ui/litellm-dashboard/src/components/add_model/ComplexityRouterConfig.test.tsx b/ui/litellm-dashboard/src/components/add_model/ComplexityRouterConfig.test.tsx index b517f27cdf6..ac443f28157 100644 --- a/ui/litellm-dashboard/src/components/add_model/ComplexityRouterConfig.test.tsx +++ b/ui/litellm-dashboard/src/components/add_model/ComplexityRouterConfig.test.tsx @@ -1301,7 +1301,8 @@ describe("ComplexityRouterConfig tier editing", () => { it("lets an edited tier set write its own opening instructions instead of refusing a prompt outright", () => { renderWithProviders(); fireEvent.click(screen.getByText("Advanced: Classification Method")); - expect(screen.getByText("write calibration examples of your own", { exact: false })).toBeInTheDocument(); + expect(screen.getByText("your own calibration examples", { exact: false })).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Edit prompt" })).toBeInTheDocument(); expect(screen.queryByText("A replacement prompt drops the tier bullets", { exact: false })).not.toBeInTheDocument(); }); @@ -1315,7 +1316,7 @@ describe("ComplexityRouterConfig tier editing", () => { ); fireEvent.click(screen.getByText("Advanced: Classification Method")); expect(screen.getByText("Replace the built-in complexity rubric", { exact: false })).toBeInTheDocument(); - expect(screen.queryByText("write calibration examples of your own", { exact: false })).not.toBeInTheDocument(); + expect(screen.queryByText("your own calibration examples", { exact: false })).not.toBeInTheDocument(); }); it("leaves built-in routers with their display-name inputs and no restriction copy", () => {