Skip to content

feat(studio): show provider display names from the BFF - #2331

Merged
peppescg merged 2 commits into
mainfrom
feat/studio-provider-display-names-2260
Oct 15, 2026
Merged

peppescg merged 2 commits into
mainfrom
feat/studio-provider-display-names-2260

Conversation

@peppescg

@peppescg peppescg commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Part of a 4-PR stack: #2329 → #2330 → #2331 → #2332. Review in any order; merge bottom-up.

Summary

Studio named a provider by title-casing its ID, so openai read "Openai" and openrouter read "Openrouter". The daemon and the SDK identify a provider only by ID, so Studio's BFF now maps each ID the daemon registers to its proper name, and the web app shows the name it receives. An ID outside the map, such as an operator-defined provider, is title-cased exactly as before, so those providers look the same.

What changed

  • BFF (apps/server). A new providerDisplayName(id) in src/mecatl/provider-names.ts holds the one map. Both settings responses and a session's detail use it.
  • Contracts (apps/contracts). The provider settings responses carry displayName on each provider entry and providerDisplayName on each inventory model. The session detail's resolved model carries providerDisplayName too. openapi.json and the generated client are regenerated.
  • Web (apps/web). These surfaces now show the BFF's name:
    • Settings > Providers rows.
    • The provider page heading, which showed the raw ID. It shows the name once the BFF has described the provider, and the requested ID until then. The raw ID stays in the Provider ID fact. The heading now wraps between words (break-words), as Studio's other names do. break-all suits an unbroken ID but can split a name mid-word on a phone.
    • The chat model menu's provider groups, on desktop and in the phone sheet.
    • A live chat's context usage label ("gpt-5 · OpenAI"), in the tooltip and the phone sheet.
  • Model filter. It matches a provider's name or its ID, so "OpenAI", "OpenAI Codex" and "openai-codex" all find Codex models. Before, an ID with a hyphen didn't match, because the filter compared against the title-cased name.
  • Clean-up. The web app's three copies of the title-casing helper that named providers are gone. No other behavior changes.

Where the names come from

The daemon reports no display name for a provider. In ListModels, ModelInfo.display_name names models; ProviderStatus carries provider_id, state, hint, model_count and two default-model flags, but no name. So the BFF maps the provider IDs in the daemon's registry (internal/app/registry.go, listed in docs/architecture/providers.md):

ID Name
anthropic Anthropic
mock Mock
openai OpenAI
openai-codex OpenAI Codex
opencode OpenCode Go
openrouter OpenRouter
openrouter-anthropic OpenRouter Anthropic
toolhive ToolHive
toolhive-anthropic ToolHive Anthropic

The registry also reserves model-router (delegation discovery only, never an inference provider) and websearch (web search settings), but neither names a model provider, so the map leaves them out. Any other ID falls back to the title-cased ID. Having the daemon report a display name per provider, so that operator-defined providers could carry their own name, would be a follow-up. The BFF would then prefer that name and keep this map as the fallback.

Difference from the prototype

  • The prototype keeps a label map in the web app (lib/provider-label.ts). Studio keeps one map, in the BFF, because the BFF owns Studio's contracts. The web app has no map.
  • The prototype labels mock "Offline (mock)" and toolhive "ToolHive gateway". Studio uses the plain names "Mock" and "ToolHive". The designer is to confirm these two names. The prototype's map also lists IDs the daemon never registers (azure, bedrock, google, vertex) and lacks openai-codex, opencode and the -anthropic siblings.
  • The prototype's model menu still title-cases the ID (model-picker.tsx), so it reads "Openai" there while its Settings page reads "OpenAI". Studio shows the BFF's name on every surface.
  • The prototype's provider page is a models page titled "Anthropic models". Studio's provider page keeps its own layout (status, facts, models) and is titled with the name alone, "OpenAI".

No regression

Pins first. Commit 1 (ed4989ac7) adds pins that pass on the base and pass unchanged on the head:

  • Web (provider-names.pinning.test.tsx). For an operator-defined provider (team-gateway), these keep "Team Gateway":

    • the Settings provider row;
    • the desktop model menu and the phone sheet, both group label and filter;
    • the usage label.

    The provider page keeps its Provider ID fact and model list.

  • BFF. Every provider and model field and value in both settings responses, over HTTP too, plus the session detail's resolved model. The integration test does the same against a spawned mecated --mock.

New tests.

  • BFF map: each registry ID's name; the title-cased fallback, the same strings Studio rendered before; exact matching only, with no case-folding or prefix match; object built-in names such as constructor are treated as ordinary IDs.
  • BFF responses: the names in both settings responses, over HTTP and in the session detail.
  • Contract: each response parses against its Zod schema unchanged, and the schema rejects an entry with no name.
  • Integration: the real daemon path names the mock provider "Mock".
  • Web: each surface shows "OpenAI"; the filter finds a provider by name and by ID; the workspace takes the menu's group name from the inventory.

Modified tests. No assertion was removed or loosened.

  • settings-alignment.test.tsx asserted that the row read "Openai", the bug this fixes. It now asserts that the name element reads exactly "OpenAI".
  • Four exact-shape BFF assertions gained the new key and stay exact: two in mecatl/settings.test.ts, one in routes/settings.test.ts, one in mecatl/chat.test.ts.
  • Fixtures gained the name the BFF sends for their ID:
    • Typed fixtures, which TypeScript now requires: chat-composer*.test.tsx, chat-workspace.integration.test.tsx, settings-*.test.tsx (including Studio settings: replace the phone section select with the prototype's section index #2261's new settings-index.test.tsx), routes/*.test.ts.
    • JSON fixtures that stand in for the BFF: session-surfaces.*.test.tsx, session-inspection.test.tsx, and the e2e specs settings-layout, phone-overflow, side-panel-shell and composer-execution-line. Without the field, the usage label would read "model · undefined".

Mutation proof. 15 mutations, each killed by at least one test:

  • BFF: drop openai from the map; return the raw ID as the fallback; skip the name on status rows, synthesised rows, models, or the session detail. The session-detail mutation is also caught by the integration suite.
  • Web: show the ID in the provider row, the page heading, or either group header; let the heading break anywhere; drop the name match or the ID match from the filter; show the ID in the usage label; map the ID as the workspace's label.

With the base's production code restored under the head's tests, 13 display-name tests fail and every pin passes.

Screenshots

Before is main (42b933fb4) and After is 29f12edbc, this PR's change before the stack rebase; the rebased f4369bd0e carries the same change plus one fixture line in #2261's settings-index.test.tsx. Both trees render the same offline fixtures, and the prototype is stack-08. Red boxes mark before/after differences.

Settings > Providers. "Openai" and "Openrouter" become "OpenAI" and "OpenRouter", matching the prototype's "OpenAI". "Anthropic" and the operator-defined "Team Gateway" (no map entry, so title-cased) are unchanged. The phone frames predate the stack, so they still show the native section picker that #2261 (below this PR) replaces.

Settings > Providers, desktop light

Settings > Providers, desktop light, zoomed

Settings > Providers: desktop dark, phone light and dark

Settings > Providers, desktop dark

Settings > Providers, desktop dark, zoomed

Settings > Providers, phone light

Settings > Providers, phone dark

Provider page. The heading changes from the raw ID "openai" to "OpenAI", and the Provider ID fact keeps "openai". The prototype names the provider the same way ("OpenAI models"); its page is a models table, a layout this PR doesn't adopt.

Provider page, desktop light

Provider page, desktop light, zoomed

Provider page: desktop dark, phone light and dark

Provider page, desktop dark

Provider page, desktop dark, zoomed

Provider page, phone light

Provider page, phone dark

Chat model menu. On desktop, the group headers "Openai" and "Openrouter" become "OpenAI" and "OpenRouter". This deliberately differs from the prototype, whose model menu title-cases the ID and reads "Openai" (model-picker.tsx); After matches the prototype's own Settings name instead. The phone sheet uppercases group headers, so "OPENAI" looks the same before and after (0 changed pixels); it matches the prototype's sheet.

Chat model menu, desktop light

Chat model menu, desktop light, zoomed

Chat model menu: desktop dark, phone light and dark

Chat model menu, desktop dark

Chat model menu, desktop dark, zoomed

Chat model menu, phone light

Chat model menu, phone dark

Live chat usage label (phone sheet). "gpt-5 · Openai" becomes "gpt-5 · OpenAI". The bar and "~25% of context" move about 2 px right because the name is wider; nothing below the line changes. The prototype's sheet has no usage line, so its column shows the closest equivalent, its composer options sheet. On desktop the label appears only in the tooltip, so there is no desktop frame.

Usage label: phone light and dark

Usage label, phone light

Usage label, phone dark

Each tree was captured twice. Between the two captures of the same tree, at most 3 pixels differ in any frame, so every boxed change is real.

Gates

#2329 and #2330 have merged, so this PR is now based on main (4aa238f3c), and this branch is f4369bd0e. All gates ran through the shared gate lock.

Gate This branch (f4369bd0e)
Biome, typecheck, generated-artifact check pass: Biome 523 files; no drift
Server tests 27 files, 252 tests: 251 pass, 1 fails, and the failure is also on main (see below)
Web tests 177 files, 1,541 tests, all pass
BFF integration (mecated --mock) 8 passed

The one server failure is routes/knowledge.test.ts > "declares the transport errors the validation hook and error handler can return". It expects 15 knowledge operations, and main now has 16 after #2155 added the skill files route. main's own CI fails the same way at 4aa238f3c; #2355 fixes it. This PR does not touch the knowledge routes.

The browser journeys ran at the top of the stack (#2332): 170 tests: 132 passed, 38 skipped. This PR adds no journey.

Closes #2260
Part of #2210

🤖 Generated with Claude Code

peppescg and others added 2 commits October 15, 2026 15:07
Pin how Studio names a provider that has no display name, such as an
operator-defined gateway. The Settings provider row, the chat model menu
and phone sheet (group labels and search), and a live chat's context
usage label all title-case the provider ID. The provider page keeps its
raw Provider ID fact and model list.

Also pin the BFF side: the provider and model inventory fields in both
settings responses, over HTTP too, and the session detail's resolved
model, including against a spawned mecated --mock.

Each pin must pass unchanged once provider display names land.

Refs #2260

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Studio named a provider by title-casing its ID, so `openai` read
"Openai". The daemon and the SDK identify a provider only by ID, so the
BFF now maps each ID the daemon registers to its name (OpenAI,
Anthropic, OpenRouter, and the rest) and title-cases any other ID, as
Studio did before.

The contracts carry the name: `displayName` on each provider entry, and
`providerDisplayName` on each inventory model and on a session's
resolved model. Settings > Providers, the provider page heading, the
chat model menu and phone sheet, and a live chat's context usage label
show it. The model filter matches a provider's name or its ID. The web
app's three title-casing helpers are gone.

The provider page heading shows the name and wraps between words; the
raw ID stays in the Provider ID fact.

Closes #2260

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@peppescg
peppescg force-pushed the feat/studio-provider-display-names-2260 branch from a0d67ae to f4369bd Compare October 15, 2026 13:12
@peppescg
peppescg merged commit e059070 into main Oct 15, 2026
30 of 31 checks passed
@peppescg
peppescg deleted the feat/studio-provider-display-names-2260 branch October 15, 2026 13:20
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Oct 20, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio settings: show provider display names ("OpenAI", not "Openai")

2 participants