fix(web): default provider selection for users without Codex#4117
fix(web): default provider selection for users without Codex#4117mfazekas wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
New projects created via the command palette hard-coded codex as their defaultModelSelection, and the composer dispatched a persisted instance id even when that instance was known-disabled. Users without Codex got threads permanently pinned to a provider that can never start (issue pingdotgg#4116). - CommandPalette: resolve the project default to the first ready provider instance (falling back to enabled, then the codex literal) and stamp that instance's default model instead of the codex one; add missing providers dependency so the callback doesn't capture the at-mount provider list. - ChatComposer: when the persisted instance is known-but-disabled, fall through to an enabled instance instead of returning the raw id. - resolveSelectableProviderInstance: prefer ready instances so an enabled codex without the CLI installed no longer wins by list order.
f720ae6 to
d6da114
Compare
ApprovabilityVerdict: Approved Bug fix with limited scope to provider selection fallback logic. Changes ensure working providers are preferred over errored ones when user doesn't have Codex. Well-tested with clear intent and self-contained to provider selection utilities. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d6da114. Configure here.
… recovery Review follow-ups on the pingdotgg#4116 fix: - resolveSelectableProviderInstance: fall back ready -> non-error -> enabled so unprobed (warning) instances beat errored ones; previously an enabled codex with a failed probe could still win by list order during startup. - ChatComposer: abandon a known-disabled persisted instance only when an enabled instance satisfies the thread's driver/continuation lock, keeping the accurate server error otherwise; derive the composer's driver kind from the resolved instance so options and send context follow the instance that actually runs. - CommandPalette: stamp the resolved instance's own default model via instance-scoped lookup instead of the driver default, which could pair a custom instance with another instance's model slug. - Tests for the fallback tiering, requested-instance retention, and the instance-scoped model helper.
|
Pushed a follow-up commit addressing the review findings:
Added unit tests for the fallback tiering, requested-instance retention, and the model helper. |

What Changed
codexas the new project'sdefaultModelSelection. It resolves the first usable provider instance (ready → non-error → enabled, then the codex literal), stamps that instance's own default model, and adds the missingprovidersentry to the callback dependencies so the handler does not act on the at-mount provider snapshot.resolveSelectableProviderInstancetiers its fallback by probe status andgetDefaultProviderInstanceModelprovides an instance-scoped default model. Unit tests cover the tiering, requested-instance retention, and the model helper.Why
Fixes #4116. New users without Codex get their first palette-created project defaulted to codex, so the first thread fails (
Failed to spawn Codex App Server processon fresh settings, orProvider instance 'codex' is disabled in T3 Code settings.when codex is disabled) and the thread stays permanently pinned to codex. The composer change also lets existing broken threads recover: on the next send they fall through to a working provider.UI Changes
Before (thread pinned to codex, turn fails, composer shows the OpenAI icon with a claude model):
After (same flow defaults to the ready Claude instance and the send succeeds):
Checklist
Note
Fix default provider selection in command palette and composer for users without Codex
codex/DEFAULT_MODELfallback in CommandPalette.tsx with logic that picks the best available provider instance and its default model usingresolveSelectableProviderInstanceandgetDefaultProviderInstanceModel.getDefaultProviderInstanceModelto providerInstances.ts, which prefers the first non-custom model for an instance, then the first listed model, then the driver-level default.resolveSelectableProviderInstanceto rank instances by status:readyfirst, then non-error(e.g.warning), then any enabled instance — instead of picking arbitrarily.codex.Macroscope summarized caf8c05.