Skip to content

Fix connected provider defaults for new threads - #1151

Merged
ymichael merged 3 commits into
mainfrom
bb/fix-new-thread-provider-defaults
Aug 7, 2026
Merged

ymichael merged 3 commits into
mainfrom
bb/fix-new-thread-provider-defaults

Conversation

@ymichael

@ymichael ymichael commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • mark the automatically selected connected provider as a client preference so thread creation uses the provider shown in the composer
  • derive onboarding agent order from the same built-in provider catalog used by the model picker
  • add regression coverage for client provenance, server resolution, and connected-agent ordering

Root cause

For projects without saved execution defaults, the composer displayed the first connected provider but sent empty execution-input provenance. The server intentionally discarded displayed-only provider/model values, fell back to Codex, and persisted that resolved default.

Testing

  • pnpm exec turbo run test --filter=@bb/app -- --run src/hooks/useThreadCreationOptions.test.tsx src/views/RootComposeView.test.ts
  • pnpm exec turbo run test --filter=@bb/server -- --run test/system/onboarding.test.ts test/services/threads/thread-execution-plan.test.ts
  • pnpm exec turbo run typecheck --filter=@bb/app
  • pnpm exec turbo run typecheck --filter=@bb/server
  • pnpm exec turbo run lint --filter=@bb/app --filter=@bb/server
  • Prettier and git diff --check

@SawyerHood

SawyerHood commented Aug 7, 2026 •

Copy link
Copy Markdown
Collaborator

🚨 SLOP COP 🚨 · review

I am reviewing this PR now. I will check security, code quality, architecture, performance, and the new-thread flow in the app.

Comment thread apps/app/src/views/RootComposeView.tsx Resolved
Comment thread apps/app/src/views/RootComposeView.tsx Resolved

@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

The form now puts a name tag on the helper it shows. Another computer or a fast click can still choose the wrong helper.

Findings

  1. High — The fallback can use the wrong machine's provider. The agent query checks the primary machine. The composer can target another machine.

    The new source marks the primary provider as a client preference. The server then honors it on the target machine.

  2. Medium — Unknown project defaults can become a saved client override. An optimistic project uses null for unknown defaults.

    Cached agent data can arrive first. A fast submit can override the real default and save the temporary provider.

  3. Low — Provider priority has three sources. Catalog order and separate client and server constants all define the policy.

    Move this product policy to one server-owned source.

I found no security or performance issue.

Validation

  • All 67 focused application tests passed.
  • All 11 focused server tests passed.
  • The application and server type checks passed.
  • The diff check passed.
  • The local app created a thread with the displayed Codex provider.
  • I stopped the local test thread and the development server.
  • The single-machine browser check cannot cover the two-machine defect.

I posted this as a comment-only review, as required.

@ymichael

ymichael commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

Also addressed the provider-policy cleanup in 1e3840d: the app no longer hard-codes Codex for an unset selection, and the server derives its product fallback from the first provider in the canonical catalog. Model-picker order, connected-provider priority, and the no-selection fallback now share that catalog source.

@ymichael
ymichael merged commit 7d1abed into main Aug 7, 2026
10 checks passed
@ymichael
ymichael deleted the bb/fix-new-thread-provider-defaults branch August 7, 2026 19:10
amadad pushed a commit to amadad/bb that referenced this pull request Aug 14, 2026
## Summary

- mark the automatically selected connected provider as a client
preference so thread creation uses the provider shown in the composer
- derive onboarding agent order from the same built-in provider catalog
used by the model picker
- add regression coverage for client provenance, server resolution, and
connected-agent ordering

## Root cause

For projects without saved execution defaults, the composer displayed
the first connected provider but sent empty execution-input provenance.
The server intentionally discarded displayed-only provider/model values,
fell back to Codex, and persisted that resolved default.

## Testing

- `pnpm exec turbo run test --filter=@bb/app -- --run
src/hooks/useThreadCreationOptions.test.tsx
src/views/RootComposeView.test.ts`
- `pnpm exec turbo run test --filter=@bb/server -- --run
test/system/onboarding.test.ts
test/services/threads/thread-execution-plan.test.ts`
- `pnpm exec turbo run typecheck --filter=@bb/app`
- `pnpm exec turbo run typecheck --filter=@bb/server`
- `pnpm exec turbo run lint --filter=@bb/app --filter=@bb/server`
- Prettier and `git diff --check`
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