From ed671f57bfdbaf55c0b1c0fd950ce188187788c6 Mon Sep 17 00:00:00 2001 From: "commitperclip[bot]" <284812584+commitperclip[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 12:58:37 -0600 Subject: [PATCH] fix: Display Ollama billers with their product names in cost views (#20420) > [!NOTE] > Opened by Prospector's automated issue-fix pipeline. A maintainer reviews and decides; nothing here merges on its own. ## Thinking Path - Issue #16573 reports a defect in paperclipai/paperclip. - Root cause, as the fixing agent read it: The shared providerDisplayName map omitted ollama and ollama-cloud, causing all cost views using it to display the raw slugs. - This pull request: Display Ollama billers with their product names in cost views ## What Changed - `ui/src/lib/utils.ts`: Add Ollama and Ollama Cloud names in the shared formatter used by cost views. - `ui/src/lib/utils.provider-display-name.test.ts`: Reproduce the missing names and cover case-insensitive lookup and unchanged fallback behavior. Confirmed failure before the fix; all 20 selected tests and the workspace typecheck passed afterward. ## Verification - Reproducing test(s), added in this PR: `ui/src/lib/utils.provider-display-name.test.ts` - They fail on the base commit and pass with the fix, each twice in a fresh sandbox. - 3 independent attempts wrote 3 reproductions; this fix passes every one of them. - The repository's compile command passes with the fix applied. - 10 existing test file(s) near the change passed. - The full test suite passes except for the 16 file(s) that already fail on the base commit. ## Risks - Written by an automated pipeline, not a person: review it as you would an outside contribution. - Risk tier of the touched paths: 3. ## Model Used - codex:gpt-6.1-sol, opus, sonnet (Anthropic Claude, via Claude Code; OpenAI, via the Codex CLI), writing and checking the change in an isolated sandbox. - opus (Anthropic Claude, via Claude Code), reviewing it independently. ## Linked Issues Fixes #16573 Other pull requests that name #16573: - #16609 (open): fix(ui): map Ollama and Ollama Cloud biller slugs to human-readable names - #16590 (open): fix(ui): format ollama and ollama-cloud provider names in cost views - #16574 (open): fix(ui): show Ollama and Ollama Cloud by name in cost views ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [ ] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with 'Fixes: #' / 'Closes #' / 'Refs #' OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub '#NNN' / 'github.com/paperclipai/paperclip' URLs) - [ ] My branch name describes the change (e.g. 'docs/...', 'fix/...') and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [ ] I will address all Greptile and reviewer comments before requesting merge Co-authored-by: commitperclip[bot] <284812584+commitperclip[bot]@users.noreply.github.com> --- .../lib/utils.provider-display-name.test.ts | 22 +++++++++++++++++++ ui/src/lib/utils.ts | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 ui/src/lib/utils.provider-display-name.test.ts diff --git a/ui/src/lib/utils.provider-display-name.test.ts b/ui/src/lib/utils.provider-display-name.test.ts new file mode 100644 index 00000000000..2c5c12c8473 --- /dev/null +++ b/ui/src/lib/utils.provider-display-name.test.ts @@ -0,0 +1,22 @@ +import { describe, expect, it } from "vitest"; +import { providerDisplayName } from "./utils"; + +describe("providerDisplayName", () => { + it.each([ + ["ollama-cloud", "Ollama Cloud"], + ["ollama", "Ollama"], + ["OLLAMA-CLOUD", "Ollama Cloud"], + ["OLLAMA", "Ollama"], + ])("displays %s as %s", (provider, name) => { + expect(providerDisplayName(provider)).toBe(name); + }); + + it.each([ + ["openrouter", "OpenRouter"], + ["anthropic", "Anthropic"], + ["custom-provider", "custom-provider"], + ["", ""], + ])("preserves the display name for %s", (provider, name) => { + expect(providerDisplayName(provider)).toBe(name); + }); +}); diff --git a/ui/src/lib/utils.ts b/ui/src/lib/utils.ts index 0c2a2b7c2c6..af426b36b7a 100644 --- a/ui/src/lib/utils.ts +++ b/ui/src/lib/utils.ts @@ -130,6 +130,8 @@ export function providerDisplayName(provider: string): string { aws_bedrock: "AWS Bedrock", openai: "OpenAI", openrouter: "OpenRouter", + ollama: "Ollama", + "ollama-cloud": "Ollama Cloud", chatgpt: "ChatGPT", google: "Google", cursor: "Cursor",