Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix(tests): give the LLMModel fixtures the fields the type now requires (#17750)

simonrosenbergc3c252ad6196
diff --git a/.pr/perplexity-provider-key/index.html b/.pr/perplexity-provider-key/index.html
deleted file mode 100644
index a888c0efcd..0000000000
--- a/.pr/perplexity-provider-key/index.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!doctype html>
-<html><head><meta charset="utf-8"><title>perplexity provider key - repro evidence</title>
-<style>body{font-family:system-ui;margin:2rem;background:#141414;color:#eee}img{max-width:100%;border:1px solid #444}code{background:#222;padding:2px 6px;border-radius:4px}</style></head>
-<body>
-<h1>map-provider.ts: misspelled <code>perlexity</code> key</h1>
-<p>The backend addresses providers by their litellm id (<code>perplexity</code>). The map key <code>perlexity</code>
-never matches, so <code>mapProvider("perplexity")</code> falls through to the raw id and
-<code>getProviderId("Perplexity AI")</code> round-trips the misspelling back to the settings API.</p>
-<h2>Terminal evidence (before / after, repro run twice)</h2>
-<img src="terminal.png" alt="vitest before: 2 failed; after: 2 passed; repro script output">
-</body></html>
diff --git a/.pr/perplexity-provider-key/terminal.png b/.pr/perplexity-provider-key/terminal.png
deleted file mode 100644
index d3216bfda9..0000000000
Binary files a/.pr/perplexity-provider-key/terminal.png and /dev/null differ
diff --git a/.pr/token-count-rounding-repro.png b/.pr/token-count-rounding-repro.png
deleted file mode 100644
index dc9a94f8ea..0000000000
Binary files a/.pr/token-count-rounding-repro.png and /dev/null differ
diff --git a/__tests__/components/settings/llm-profiles/add-models-modal.test.tsx b/__tests__/components/settings/llm-profiles/add-models-modal.test.tsx
index 07a102128d..984d64a446 100644
--- a/__tests__/components/settings/llm-profiles/add-models-modal.test.tsx
+++ b/__tests__/components/settings/llm-profiles/add-models-modal.test.tsx
@@ -80,9 +80,27 @@ const httpError = (status: number, detail?: string) => {
const MODELS = {
items: [
- { provider: "openhands", name: "trinity-large-thinking", verified: true },
- { provider: "openhands", name: "deepseek-v4-flash", verified: true },
- { provider: "openhands", name: "unverified-model", verified: false },
+ {
+ provider: "openhands",
+ name: "trinity-large-thinking",
+ verified: true,
+ free: false,
+ default: false,
+ },
+ {
+ provider: "openhands",
+ name: "deepseek-v4-flash",
+ verified: true,
+ free: false,
+ default: false,
+ },
+ {
+ provider: "openhands",
+ name: "unverified-model",
+ verified: false,
+ free: false,
+ default: false,
+ },
],
next_page_id: null,
};
@@ -177,7 +195,13 @@ describe("AddModelsModal", () => {
// and the filter is hiding them sends the user looking for the wrong thing.
vi.mocked(ConfigService.searchModels).mockResolvedValue({
items: [
- { provider: "openhands", name: "unverified-only", verified: false },
+ {
+ provider: "openhands",
+ name: "unverified-only",
+ verified: false,
+ free: false,
+ default: false,
+ },
],
next_page_id: null,
});
@@ -457,9 +481,7 @@ describe("AddModelsModal", () => {
setOpen(false);
await waitFor(() =>
- expect(
- screen.queryByTestId("add-models-modal"),
- ).not.toBeInTheDocument(),
+ expect(screen.queryByTestId("add-models-modal")).not.toBeInTheDocument(),
);
await queryClient.refetchQueries({
queryKey: ["config", "models", "openhands"],
@@ -468,9 +490,7 @@ describe("AddModelsModal", () => {
setOpen(true);
await screen.findByTestId("add-models-modal");
expect(screen.getByTestId("add-models-provider")).toHaveValue("");
- expect(
- screen.queryAllByTestId(/^add-models-row-/),
- ).toHaveLength(0);
+ expect(screen.queryAllByTestId(/^add-models-row-/)).toHaveLength(0);
});
it("starts a fresh session when the modal is reopened", async () => {