Skip to content

Fix model settings getting stuck#1538

Merged
juliusmarminge merged 4 commits intopingdotgg:mainfrom
Alexx999:pr-fix-sticky-settings
Mar 30, 2026
Merged

Fix model settings getting stuck#1538
juliusmarminge merged 4 commits intopingdotgg:mainfrom
Alexx999:pr-fix-sticky-settings

Conversation

@Alexx999
Copy link
Copy Markdown
Contributor

@Alexx999 Alexx999 commented Mar 29, 2026

What Changed

Removed option stripping logic

Why

Currently, selecting non-default option for Text Generation Model results in setting getting stuck. For example, switching Fast Mode to 'on' for Opus & GPT works, but you can't turn it off, same with switching Thinking to 'off' for Haiku - it gets stuck and you won't be able to switch it to "on"

Checklist

  • This PR is small and focused
  • I explained what changed and why

Note

Medium Risk
Changes model option normalization for Claude/Codex across web and server, which can alter what options get dispatched/persisted (notably preserving explicit defaults like fastMode: false, thinking: true, and contextWindow). Also adjusts server settings default-stripping equality for arrays, which affects what gets written to settings.json.

Overview
Fixes model settings toggles getting stuck by switching Claude/Codex option normalization to capability-aware shared helpers that preserve explicit boolean/default values (so deepMerge can overwrite prior selections) and drop unsupported options.

Moves normalization logic into packages/shared/src/model.ts, removes the server/provider-specific normalizers, updates both Git text generation layers and the web composer state to use the new functions, and expands coverage with regression tests (including contextWindow). Separately, server settings persistence now uses Equal.equals for array comparisons, and the server settings patch schema now allows claudeAgent.options.contextWindow.

Written by Cursor Bugbot for commit 27d36bc. This will update automatically on new commits. Configure here.

Note

Fix model settings getting stuck by preserving explicit boolean and default values during normalization

  • Introduces normalizeClaudeModelOptionsWithCapabilities and normalizeCodexModelOptionsWithCapabilities in packages/shared/src/model.ts, replacing local implementations in both server and web layers.
  • The new functions correctly preserve explicit false for fastMode, explicit true for thinking, and default contextWindow values instead of stripping them, which was the root cause of settings getting stuck.
  • Options for unsupported capabilities (e.g. contextWindow on models that don't support it) are now omitted rather than carried through.
  • Fixes array equality in apps/server/src/serverSettings.ts by replacing JSON.stringify comparison with Equal.equals for structural equality.
  • ClaudeModelOptionsPatch in packages/contracts/src/settings.ts now includes an optional contextWindow field to support partial updates.

Macroscope summarized 27d36bc.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 29, 2026

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

Run ID: 45826c92-dbdb-46f6-8293-a732c3425008

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions github-actions bot added size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 29, 2026
- Preserve default context window values so dispatch can clear stale selections
- Move shared model option normalization into shared utilities
- Use structural equality when stripping default server settings arrays
@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Mar 30, 2026
- Allow `contextWindow` to round-trip through Claude model settings patches
- Remove the obsolete default-settings test
@juliusmarminge juliusmarminge enabled auto-merge (squash) March 30, 2026 01:12
@juliusmarminge juliusmarminge merged commit 792ad4b into pingdotgg:main Mar 30, 2026
11 checks passed
TimCrooker added a commit to TimCrooker/t3code that referenced this pull request Mar 30, 2026
Resolve modify/delete conflict on packages/contracts/src/settings.test.ts
by accepting main's deletion — the file was removed in pingdotgg#1538 and the
colorblind default is covered by the schema itself.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Chrono-byte pushed a commit to Chrono-byte/t3code that referenced this pull request Mar 31, 2026
Co-authored-by: Julius Marminge <julius0216@outlook.com>
xddinside pushed a commit to xddinside/t3code that referenced this pull request Apr 4, 2026
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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