Skip to content

Disambiguate Pi models by provider - #1170

Merged
ymichael merged 4 commits into
mainfrom
bb/investigate-pi-model-availability-thr_9x7fthq5dc
Aug 8, 2026
Merged

ymichael merged 4 commits into
mainfrom
bb/investigate-pi-model-availability-thr_9x7fthq5dc

Conversation

@ymichael

@ymichael ymichael commented Aug 7, 2026 •

Copy link
Copy Markdown
Collaborator

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

@SawyerHood

Copy link
Copy Markdown
Collaborator

🚨 SLOP COP 🚨 · review

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");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 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 SawyerHood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 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 af7f8e7c fixed 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.ts can 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
@ymichael
ymichael merged commit 1610007 into main Aug 8, 2026
10 checks passed
@ymichael
ymichael deleted the bb/investigate-pi-model-availability-thr_9x7fthq5dc branch August 8, 2026 04:27
kierr added a commit to kierr/bb that referenced this pull request Aug 13, 2026
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.
amadad pushed a commit to amadad/bb that referenced this pull request Aug 14, 2026
## 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`
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.

2 participants