Preserve ACP model descriptions in the catalog and pickers - #2063
Open
bradhallett wants to merge 1 commit into
Open
Preserve ACP model descriptions in the catalog and pickers#2063bradhallett wants to merge 1 commit into
bradhallett wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
ACP agents send a per-model
descriptionon config-option select options, and the wire schema already carries it through — butbuildModelCatalogFromConfigOptionshard-codeddescription: "", 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 underlyingprovider/modelvalues differ but were invisible anywhere in the UI. Mobile already maps and renders the field; it showed nothing only because the bridge sent"". Fixes #2062What changed
plugins/provider-acp/src/wire.ts—acpConfigOptionSelectOptionSchemanow typesdescription(acpOptionalString, agent JSONnullnormalized toundefined) instead of passing it through untyped.plugins/provider-acp/src/bridge/model-catalog.ts— the config-options path mapsoption.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,routeProviderIdqualifiers, and the selectedprovider/modelvalue are unchanged.apps/mobile— no code change; added a regression test pinning the existing mapping.Wire/protocol: no
HOST_DAEMON_PROTOCOL_VERSIONbump.AvailableModel.descriptionis already a requiredz.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 modelsalready prints raw ids. Matches the fix proposed in the issue.How you verified
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 exactprovider/modelvalue).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.