Skip to content

fix(web): preserve provider options when switching models - #8560

Closed
hermabr wants to merge 1 commit into
pingdotgg:mainfrom
hermabr:t3code/preserve-provider-sticky-options
Closed

hermabr wants to merge 1 commit into
pingdotgg:mainfrom
hermabr:t3code/preserve-provider-sticky-options

Conversation

@hermabr

@hermabr hermabr commented Aug 28, 2026 •

Copy link
Copy Markdown

Problem

Switching providers replaced that provider’s sticky model selection with an option-less selection. Returning from Claude to Codex could therefore erase a saved reasoning effort such as High and fall back to the model default, Low.

Fix

Preserve existing provider-specific options when updating a sticky model selection without explicit options. When a draft has no selection for the newly active provider, restore that provider’s sticky options instead.

Add regression coverage for switching between Codex and Claude while retaining both providers’ saved options.

Verification

  • vp test run apps/web/src/composerDraftStore.test.ts — 81 passed
  • targeted formatting and lint checks
  • vp run --filter @t3tools/web typecheck

UI changes

No visual changes. Before this fix, Codex → Claude → Codex could change the saved reasoning effort from High to Low. After the fix, High is restored.

Built with gpt-5.6-sol through the Codex harness in T3 Code.


Note

Low Risk
Localized composer draft store logic with regression tests; no API or auth changes, only how per-provider model options are merged on switch.

Overview
Fixes composer draft state so provider-specific model options (e.g. Codex reasoning effort, Claude effort) are not dropped when you switch providers or update a sticky selection without passing options again.

setStickyModelSelection now reuses the existing sticky entry’s options when the incoming selection has no options field, instead of overwriting with a bare provider+model pair.

setModelSelection uses the same fallback: if the thread draft has no selection for that provider yet, it pulls options from stickyModelSelectionByProvider before merging, so returning to Codex after Claude restores High instead of defaulting to Low.

Adds a regression test that alternates Codex and Claude and asserts both providers keep their saved options in the draft and sticky maps.

Reviewed by Cursor Bugbot for commit 3b5840b. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix composerDraftStore to preserve provider options when switching models

  • setStickyModelSelection now reuses existing sticky options from state.stickyModelSelectionByProvider[instanceId] when an incoming selection has no options, instead of overwriting with an options-less entry
  • setModelSelection now falls back to the sticky selection for that provider when no per-thread selection exists, preserving options across provider switches
  • Adds a test in composerDraftStore.test.ts verifying sticky options are preserved when switching between codex and claudeAgent providers
  • Behavioral Change: calling setStickyModelSelection or setModelSelection without options now retains previously stored options rather than dropping them

Macroscope summarized 3b5840b.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1486239b-bfce-49fd-b154-b18f8818c798

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Aug 28, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 3b5840b

Macroscope's review found this PR approvable — This is a localized composer-state bug fix with targeted regression coverage. It preserves provider-specific model options during switching without changing APIs, schemas, infrastructure, or unrelated runtime paths.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge

Copy link
Copy Markdown
Member

Closing as part of the open-PR backlog sweep (wave 2).

Reason: Sticky provider options already preserved when selection omits options.
Related: #1371

Reopen if this is still wanted and you’re willing to rebase onto current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants