Skip to content

fix(app): qualify model names with their ID namespace - #6115

Closed
lemonleks wants to merge 1 commit into
get-bb:mainfrom
lemonleks:fix/model-picker-namespace-qualifiers
Closed

lemonleks wants to merge 1 commit into
get-bb:mainfrom
lemonleks:fix/model-picker-namespace-qualifiers

Conversation

@lemonleks

@lemonleks lemonleks commented Oct 22, 2026 •

Copy link
Copy Markdown

Human comments

What was wrong

Model picker rows only displayed a source qualifier when a provider supplied routeProviderId. ACP catalogs such as OMP can return identical display names for distinct, namespaced model IDs without that metadata. For example, anthropic/claude-sonnet-5-5 and openrouter/anthropic/claude-sonnet-5.5 both appeared as “Claude Sonnet 5.5”, leaving users unable to distinguish the routes before selecting one.

What changed

  • Reuse the existing qualifier rendering in the main model list and More models submenu, falling back to the model ID namespace (everything before its last slash).
  • Preserve explicit routeProviderId precedence, nested namespaces such as openrouter/anthropic, and the existing display of unqualified model IDs.
  • Omit source qualifiers for single-source catalogs. Count sources across the unfiltered primary and More models lists so search does not make qualifiers disappear.
  • Leave model selection values, model routing, and search policy unchanged.
  • Add regressions covering distinct ACP choices, exact selection IDs, single-source catalogs with explicit or inferred sources, and filtering a mixed catalog down to one source from More models. Document the display qualifiers in the provider guide.

How you verified

  • pnpm exec turbo run test --filter=@bb/app -- ModelReasoningPicker.test.tsx — 65 tests passed, including the new single-source and search regressions and the existing explicit Pi route qualifier test.
  • pnpm exec turbo run typecheck --filter=@bb/app — passed.
  • Formatted the changed picker component with the repository's oxfmt.
  • Backported the same logic to an installed 0.46.1 frontend and exercised the actual OMP catalog in a browser: search sonnet5.5, distinguish Anthropic from OpenRouter, and select the Anthropic row. The initial qualifier change was checked at 1280px and in a 390px touch drawer; the conditional update was checked by filtering the mixed catalog down to OpenRouter models and confirming the qualifier remains. No generation request was sent.

AGENT GENERATED

@github-actions

Copy link
Copy Markdown
Contributor

Thanks @lemonleks for the PR. This repo approves new contributors before it reviews their PRs, so this PR now closes on its own. That is expected. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ), post a link to this PR, and explain what it changes and why. A maintainer then adds you to the allow list and can reopen the PR.

@github-actions github-actions Bot closed this Oct 22, 2026
ymichael added a commit that referenced this pull request Oct 23, 2026
## Human comments

## What was wrong

omp and opencode namespace each model ID by the service that runs it, so
one model can appear several times under the same name. For example, omp
lists `openai/gpt-5.6-terra` (OpenAI API key) and
`openai-codex/gpt-5.6-terra` (ChatGPT subscription) as "GPT-5.6 Terra"
and "GPT-5.6-Terra". The picker already shows a grey source label from
`AvailableModel.routeProviderId`, but nothing in the ACP path set that
field, so these rows were indistinguishable. Picking the wrong one fails
(for example, an API key with no credits left returns
`credit_balance_exhausted`). #2062 reported this and was closed by
#5266, but [the follow-up
comment](#2062) confirms that the
duplicate rows remained.

## What changed

- `AcpDialect` gains an optional `presentModel(model)` hook. The bridge
applies it to every model in `model/list` results
(`packages/provider-bridge-acp/src/bridge/bridge.ts`).
- The omp and opencode dialects set `routeProviderId` to the ID's first
segment (`openrouter/anthropic/claude-sonnet-5.5` → `openrouter`) and
strip that prefix from the name when the agent repeats it (opencode's
`openai/GPT-4.1` → `GPT-4.1`). IDs without a `/` are unchanged. Other
ACP agents are untouched.
- Model IDs are unchanged, so selection, routing and search are
unaffected. The picker renders the label the way it already does for Pi,
with no app changes.
- `routeProviderId` is an existing optional field, so there is no wire
change and no `HOST_DAEMON_PROTOCOL_VERSION` bump. `AcpDialect` is part
of the plugin SDK (`experimental_registerAcpDialect`), so third-party
dialects can use the same hook. The SDK version on main (0.6.75) is
already ahead of the published 0.6.73, so no bump is needed.

This takes over the problem from #6115 by @lemonleks, who reported it
and proposed labelling rows by ID namespace. That PR inferred the label
inside the picker. This change has the omp and opencode adapters supply
it instead, which avoids doubling opencode's name prefix and lets plugin
dialects opt in.

## How you verified

- New `bridge.test.ts` case: the omp and opencode dialects label
`anthropic/…`, `openrouter/anthropic/…` and `openai/…` models and strip
opencode's duplicated prefix. The generic `acp` dialect is left
unchanged.
- `pnpm exec turbo run typecheck lint test
--filter=@bb/provider-bridge-acp`: all checks pass (538 tests).
- `pnpm exec turbo run build:types typecheck
--filter=@get-bb/plugin-sdk`: passes, and the bundled `AcpDialect` type
includes `presentModel`.
- Ran the omp dialect over a real omp 17.4.1 catalog (118 models).
`openai/gpt-5.6-terra` gets the label `openai`, and
`openai-codex/gpt-5.6-terra` gets `openai-codex`.

Fixes #2062

> AGENT GENERATED

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

1 participant