Skip to content

fix(native-chat): don't force a default model/effort on agent spawn - #9134

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/fix-native-chat-forced-model
Jul 17, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/fix-native-chat-forced-model

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

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=medium equivalents), 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 shared tui-agent-launch-command). So a user who had claude configured 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 via resolveAgentSessionOptionLaunch, so the picker keeps working for users who opt in.

  • Untouched settings → vanilla spawn (regression fixed).
  • Explicit model pick → honored (opt-in, not forced).

Because all spawn paths share this one function, the single change corrects all of them.

Verification

  • src/shared/agent-session-option-catalog.test.ts updated + new regression coverage (fresh launch → undefined; explicit pick → applied).
  • Updated the launch/onboarding/work-item/worktree-activation test expectations that encoded the old forced defaults.
  • Full renderer + shared vitest suite passes; pnpm run tc clean.

Regression reported by the user during v1.4.144 release testing; #9085 shipped in rc.4.

#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.
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0499bb36-d032-4550-ac4a-cbed78fa9dac

📥 Commits

Reviewing files that changed from the base of the PR and between 1b331f2 and 5982d2c.

📒 Files selected for processing (7)
  • src/renderer/src/components/onboarding/onboarding-folder-agent-startup.test.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/renderer/src/lib/launch-work-item-direct.test.ts
  • src/renderer/src/lib/worktree-activation-created-agent.test.ts
  • src/renderer/src/store/slices/repos-onboarding-folder-startup.test.ts
  • src/shared/agent-session-option-catalog.test.ts
  • src/shared/native-chat-session-option-defaults.ts

📝 Walkthrough

Walkthrough

Native 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)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change well, but it omits required template sections like Screenshots, Testing, AI Review Report, Security Audit, and Notes. Add the missing template sections: Summary, Screenshots, Testing checklist, AI Review Report, Security Audit, and Notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: removing forced default model/effort flags on agent spawn.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@brennanb2025
brennanb2025 merged commit 1284a00 into main Jul 17, 2026
2 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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.
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.

1 participant