Repository navigation
Disambiguate Pi models by provider - #1170
Conversation
|
🚨 SLOP COP 🚨 · I am the SlopCop. I am reviewing this pull request for security, code quality, performance, architecture, and the user path. |
| name: "Provider, model and reasoning", | ||
| }); | ||
| expect(trigger.textContent).toContain(modelLabel); | ||
| expect(trigger.textContent).not.toContain("openai-codex"); |
There was a problem hiding this comment.
🚨 slopcop/review — Keep the selected route visible when the picker closes
This assertion makes the control ambiguous again after selection. The two Pi routes can use different authentication, billing, and content destinations. A user cannot confirm the selected route before submission without reopening the menu. Include selectedModelOption.routeProviderId in the closed text and tooltip. Then assert that each selected duplicate route stays visible.
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
ELI5: Pi can offer one model through two routes. This change adds each route name to the open menu.
Finding
- High: The closed control hides the route again. The route can change authentication, billing, and the content destination. Keep the selected route visible before submission. See the inline comment.
Review notes
- Commit
af7f8e7cfixed the stale generated plugin SDK and template contracts during this review. - I found no injection, authorization, unsafe cast, or protocol-version issue.
- I found no new performance blocker. A later change can limit qualifiers to duplicate labels or add list virtualization.
- Two model-to-picker conversions repeat the same mapping. A helper in
model-picker-option.tscan prevent future metadata loss.
Validation
- The focused app tests passed: 28 tests.
- The Pi runtime tests passed: 6 tests.
- The daemon contract tests passed: 49 tests.
- Six package type checks passed.
- The regenerated plugin SDK and template checks passed on the current head.
- The browser test showed both duplicate Pi routes in the Ladle picker. Empty dev data prevented a real compose test.
- Current CI has passed all completed checks. One macOS package check remains active.
Please keep the route visible in the closed control before merge.
…el-availability-thr_9x7fthq5dc # Conflicts: # packages/host-daemon-contract/test/contract.test.ts
…el-availability-thr_9x7fthq5dc # Conflicts: # packages/templates/src/generated/plugin-sdk-dts.generated.ts
The old main had 3 custom commits on top of an earlier upstream: - feat(acp): add pi-acp as a known ACP agent provider [KEPT] - feat(acp): show full model id slugs for pi-acp provider [KEPT] - fix(pi): show full provider/id slug in pi provider model picker [DROPPED - superseded by upstream get-bb#1170] All changes from old main are already present in this branch (commits daf36b3 and 662ad66 rebased onto upstream/main). The dropped commit's change is superseded by upstream's routeProviderId approach (get-bb#1170). Using -s ours since the rebased commits already contain the desired state.
## Summary - add optional `routeProviderId` metadata to available models and populate it from the Pi catalog without changing friendly display names - show the nested provider as muted text in model-picker rows and include it in search, while keeping the closed selected value unchanged - cover duplicate `gpt-5.3-codex-spark` routes so `openai` and `openai-codex` remain visibly and behaviorally distinct - bump the host daemon protocol to 83 for the model-list wire-contract change; current `main` already uses 82 for authenticated Pi model resolution ## Root cause Pi can expose the same friendly model name through multiple nested providers. Their canonical model IDs were distinct, but the picker rendered only the shared display name, making the API-backed `openai/gpt-5.3-codex-spark` route indistinguishable from the subscription-backed `openai-codex/gpt-5.3-codex-spark` route. ## Verification - `pnpm exec turbo run test --filter=@bb/app --force -- --run src/hooks/useThreadCreationOptions.test.tsx src/components/pickers/ModelReasoningPicker.test.tsx` - `pnpm exec turbo run test --filter=@bb/agent-runtime --force -- --run src/pi/bridge/__tests__/model-list.test.ts` - `pnpm exec turbo run test --filter=@bb/domain --force` - `pnpm exec turbo run test --filter=@bb/host-daemon-contract --force` - `pnpm exec turbo run typecheck --filter=@bb/domain --filter=@bb/host-daemon-contract --filter=@bb/agent-runtime --filter=@bb/server-contract --filter=@bb/server --filter=@bb/app` - `pnpm exec turbo run typecheck --filter=@bb/plugin-sdk --filter=@bb/templates --force`
Summary
routeProviderIdmetadata to available models and populate it from the Pi catalog without changing friendly display namesgpt-5.3-codex-sparkroutes soopenaiandopenai-codexremain visibly and behaviorally distinctmainalready uses 82 for authenticated Pi model resolutionRoot cause
Pi can expose the same friendly model name through multiple nested providers. Their canonical model IDs were distinct, but the picker rendered only the shared display name, making the API-backed
openai/gpt-5.3-codex-sparkroute indistinguishable from the subscription-backedopenai-codex/gpt-5.3-codex-sparkroute.Verification
pnpm exec turbo run test --filter=@bb/app --force -- --run src/hooks/useThreadCreationOptions.test.tsx src/components/pickers/ModelReasoningPicker.test.tsxpnpm exec turbo run test --filter=@bb/agent-runtime --force -- --run src/pi/bridge/__tests__/model-list.test.tspnpm exec turbo run test --filter=@bb/domain --forcepnpm exec turbo run test --filter=@bb/host-daemon-contract --forcepnpm exec turbo run typecheck --filter=@bb/domain --filter=@bb/host-daemon-contract --filter=@bb/agent-runtime --filter=@bb/server-contract --filter=@bb/server --filter=@bb/apppnpm exec turbo run typecheck --filter=@bb/plugin-sdk --filter=@bb/templates --force