feat(chat): show the model pdev actually used instead of pdev/auto
Merged
HA
1mo ago+192+192+012345678901234567890123456789-16-16-01234567890123456789
What & why
pdev chats labelled every reply with the selected alias (pdev/auto), not the model that answered. pdev 0.1.2 (release, from superset-sh/router#2) now reports the model its router resolved in _meta.piAcp.model.
AcpAdapterreads_meta.piAcp.modelon live chunks, whole v2 messages andsession/loadreplay, as either an id or a{ provider, modelId }pair, and strips thevercel-ai-gateway/prefix. Agents that send nothing keep the selected model's label.- For pdev (
agentInfo.nameisparadev/pdev) thepdev/prefix is dropped from model option labels, since the picker is already pdev's. - Bundles pdev 0.1.2. It also fixes a silent failure: when the model call failed (e.g. a provider 400 on
max_tokensforzai/glm-5.3-flashx), pdev ended the turn withend_turnand the chat showed a finished turn with no reply. It now failssession/promptwith the error, which the adapter already shows as a failed turn and an error notice.
How I tested it
packages/chat-runtime:bun test283 pass,typecheckclean; four new adapter tests (resolved model on a live message, gateway prefix stripped,pdev/dropped from labels with fallback, model kept on v2 replay).apps/desktop/scripts/build-bundled-pdev.test.tspass;bun run bundle:pdevdownloads 0.1.2 and the checksums match.- Ran the compiled pdev 0.1.2 over ACP against the production router: chunks carry
"_meta":{"piAcp":{"model":"zai/glm-5.3-flash"}}. Against a fake router returning the 400: 0.1.1 returns{"stopReason":"end_turn"}, 0.1.2 returns a JSON-RPC error with the 400 text. - Not verified in the desktop UI with screenshots.
Checklist
- PR title follows conventional commits (
type(scope): subject) -
bun run lintandbun run typecheckpass (Biome on changed files, chat-runtime typecheck) - "Allow edits from maintainers" is checked on fork PRs (not a fork PR)
Summary by cubic
pdev chats labelled every reply with the selected alias (pdev/auto) instead of the model that answered. The adapter now reads the model pdev reports in _meta.piAcp.model on live chunks, whole v2 messages, and session/load replay, accepting an id or a { provider, modelId } pair and stripping the vercel-ai-gateway/ prefix; agents that send nothing keep the selected model's label.
- pdev option labels drop the
pdev/prefix since the picker is already pdev's. - Bundles pdev 0.1.2, which also fixes a silent failure where a failed model call ended the turn with no reply; it now fails
session/promptwith the error.
Summary by CodeRabbit
- New Features
- Model names from agent metadata are now shown in chat messages, with unnecessary provider prefixes removed.
- Model option labels are simplified for supported agents.
- Updates
- The bundled pdev version is updated to 0.1.2 for supported platforms.