Repository navigation
fix(native-chat): don't force a default model/effort on agent spawn - #9134
Conversation
#9085 made resolveNativeChatSessionOptionDefaults fall back to the catalog default model (sonnet) and effort (high) whenever the user had not explicitly picked one, injecting `--model sonnet --effort high` (and codex `-m`/`-c` equivalents) onto every agent spawn: composer, worktree activation, source-control agents, onboarding, work-item launch, floating terminal, and new-tab launch. That silently overrode each user's own CLI-configured default model. Return undefined (spawn the agent exactly as its own CLI would) unless the user has explicitly selected a model, and carry only explicitly stored option values. An explicit model selection still applies that model and its catalog option defaults via resolveAgentSessionOptionLaunch.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughNative session-option resolution now relies on explicitly persisted model and validated stored values, while tests cover empty state, explicit selection, model scoping, and catalog option composition. Startup and direct-launch expectations now omit implicit session options and model/reasoning CLI expansions. Terminal launch assertions were updated across Windows, remote, WSL, web-runtime, draft, and per-launch argument scenarios. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
…tablyai#9134) stablyai#9085 made resolveNativeChatSessionOptionDefaults fall back to the catalog default model (sonnet) and effort (high) whenever the user had not explicitly picked one, injecting `--model sonnet --effort high` (and codex `-m`/`-c` equivalents) onto every agent spawn: composer, worktree activation, source-control agents, onboarding, work-item launch, floating terminal, and new-tab launch. That silently overrode each user's own CLI-configured default model. Return undefined (spawn the agent exactly as its own CLI would) unless the user has explicitly selected a model, and carry only explicitly stored option values. An explicit model selection still applies that model and its catalog option defaults via resolveAgentSessionOptionLaunch.
What
Fixes a regression from #9085: every agent spawn was being forced onto
--model sonnet --effort high(and the Codex-m gpt-5.6-sol -c model_reasoning_effort=mediumequivalents), overriding each user's own CLI-configured default model.Root cause
resolveNativeChatSessionOptionDefaults(src/shared/native-chat-session-option-defaults.ts) fell back to the catalog default model + effort whenever the user hadn't explicitly picked one ("fresh launches must be authoritative too"). That resolved{model, effort}feeds every spawn path — composer, worktree activation, source-control agents, onboarding, work-item launch, floating terminal, and new-tab launch (all via the sharedtui-agent-launch-command). So a user who hadclaudeconfigured to Opus silently got Sonnet on every launch.Fix
Return
undefined(→ spawn the agent exactly as its own CLI would, no injected flags) unless the user has explicitly selected a model, and carry only explicitly stored option values — never a forced catalog default. An explicit model selection still applies that model and its catalog option defaults viaresolveAgentSessionOptionLaunch, so the picker keeps working for users who opt in.Because all spawn paths share this one function, the single change corrects all of them.
Verification
src/shared/agent-session-option-catalog.test.tsupdated + new regression coverage (fresh launch →undefined; explicit pick → applied).pnpm run tcclean.Regression reported by the user during v1.4.144 release testing; #9085 shipped in rc.4.