Repository navigation
Fix connected provider defaults for new threads - #1151
Conversation
|
🚨 SLOP COP 🚨 · I am reviewing this PR now. I will check security, code quality, architecture, performance, and the new-thread flow in the app. |
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 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
-
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.
-
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.
-
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.
|
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. |
## 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`
Summary
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.tspnpm exec turbo run test --filter=@bb/server -- --run test/system/onboarding.test.ts test/services/threads/thread-execution-plan.test.tspnpm exec turbo run typecheck --filter=@bb/apppnpm exec turbo run typecheck --filter=@bb/serverpnpm exec turbo run lint --filter=@bb/app --filter=@bb/servergit diff --check