Skip to content

Preserve ACP model descriptions in the catalog and pickers - #2063

Open
bradhallett wants to merge 1 commit into
get-bb:mainfrom
bradhallett:acp-model-description
Open

Preserve ACP model descriptions in the catalog and pickers#2063
bradhallett wants to merge 1 commit into
get-bb:mainfrom
bradhallett:acp-model-description

Conversation

@bradhallett

Copy link
Copy Markdown

What was wrong

ACP agents send a per-model description on config-option select options, and the wire schema already carries it through — but buildModelCatalogFromConfigOptions hard-coded description: "", and the desktop option mapping dropped the field even when present. When two advertised models share a display name (e.g. two providers both surfacing "GLM 4.7"), the desktop picker rendered two indistinguishable rows: the underlying provider/model values differ but were invisible anywhere in the UI. Mobile already maps and renders the field; it showed nothing only because the bridge sent "". Fixes #2062

What changed

  • plugins/provider-acp/src/wire.tsacpConfigOptionSelectOptionSchema now types description (acpOptionalString, agent JSON null normalized to undefined) instead of passing it through untyped.
  • plugins/provider-acp/src/bridge/model-catalog.ts — the config-options path maps option.description ?? "", mirroring the session-models path a few lines below.
  • apps/app/src/hooks/useThreadCreationOptions.ts, apps/app/src/components/pickers/ModelReasoningPicker.tsx — non-empty descriptions flow into picker options and render as a subtle second line in model menu rows (main list and More Models submenu), matching the mobile picker's subtitle pattern. Labels, tags, routeProviderId qualifiers, and the selected provider/model value are unchanged.
  • apps/mobile — no code change; added a regression test pinning the existing mapping.

Wire/protocol: no HOST_DAEMON_PROTOCOL_VERSION bump. AvailableModel.description is already a required z.string() in the host-daemon contract (commands.ts), so this only populates an existing field; messages stay schema-valid for peers running older code. No CLI surface changes — bb provider models already prints raw ids. Matches the fix proposed in the issue.

How you verified

  • New tests that fail before and pass after (verified by reverting the guarded line and watching each go red, then restoring):
    • plugins/provider-acp/src/bridge/model-catalog.test.ts — "keeps per-option descriptions that disambiguate duplicate model names".
    • apps/app/src/components/pickers/ModelReasoningPicker.test.tsx — "distinguishes duplicate preview models by description and preserves value" (also asserts selection emits the exact provider/model value).
    • apps/mobile/src/data/compose/execution-options.test.ts — "carries the model description verbatim into the picker option".
    • plugins/provider-acp/src/wire.test.ts — null→undefined normalization of the new field.
  • pnpm exec turbo run typecheck --filter=bb-plugin-provider-acp --filter=@bb/app --filter=@bb/mobile — pass.
  • pnpm exec turbo run test --filter=bb-plugin-provider-acp --filter=@bb/app --filter=@bb/mobile — pass (incl. full @bb/app suite).
  • pnpm exec turbo run lint --filter=bb-plugin-provider-acp --filter=@bb/app --filter=@bb/mobile — pass.

AGENT GENERATED: by zai/glm-5.3

ACP agents send a per-model description (e.g. "provider/model-id") that
disambiguates duplicate display names across providers. The wire schema
passed it through but the catalog hard-coded an empty string, and the
desktop picker dropped it. Keep the description through the catalog and
render it as secondary text in desktop model rows, matching the mobile
picker.

> AGENT GENERATED: by zai/glm-5.3
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.

ACP bridge drops model descriptions, so the model picker shows indistinguishable duplicate rows

1 participant