Skip to content

feat(web): add default model and provider settings#1219

Closed
binbandit wants to merge 3 commits intopingdotgg:mainfrom
binbandit:t3code/default-model-provider-settings
Closed

feat(web): add default model and provider settings#1219
binbandit wants to merge 3 commits intopingdotgg:mainfrom
binbandit:t3code/default-model-provider-settings

Conversation

@binbandit
Copy link
Contributor

@binbandit binbandit commented Mar 20, 2026

Summary

  • Adds defaultProvider and defaultModel optional fields to the AppSettings schema so users can configure the model and provider used for new threads and projects
  • Wires settings into the full selection hierarchy: draft > thread > project > settings default > built-in default
  • Updates project creation (Sidebar) to propagate the default model into new projects so the setting takes effect immediately for all threads within
  • Adds a "Defaults" section to the Settings page with a model dropdown (provider dropdown conditionally rendered when multiple providers become available)
  • Fixes the draft-thread model fallback and its useMemo dependency array to include the settings default

Design decisions

  • Both fields are Schema.optional, ensuring backward compatibility with existing persisted settings (no migration needed)
  • The provider dropdown is only rendered when >1 providers are marked as available in PROVIDER_OPTIONS — currently only Codex is available, so the dropdown is hidden until more providers ship
  • Project creation in Sidebar.tsx uses appSettings.defaultModel ?? DEFAULT_MODEL_BY_PROVIDER.codex so that new projects inherit the user's preferred model — without this, activeProject.model would always be "gpt-5.4" and the settings default would be unreachable

UI

Screenshot 2026-03-20 at 3 32 08 pm Screenshot 2026-03-20 at 3 32 21 pm

Test plan

  • TypeScript compiles cleanly (tsc --noEmit)
  • All 5 related test suites pass (83/83 tests): appSettings, model, store, session-logic, composerDraftStore
  • Verify Settings page shows "Defaults" section with model dropdown
  • Change default model in settings, create a new project + thread, confirm thread uses the selected default
  • Verify existing projects/threads are unaffected by the new setting
  • Verify /model command still works correctly to override the default per-thread
  • Verify "Restore defaults" button resets both fields

🤖 Generated with Claude Code

Note

Add default provider and model settings to the web app

  • Extends appSettings.ts with optional defaultProvider and defaultModel fields in the app settings schema.
  • Adds a 'Defaults' section to the Settings page where users can select a default provider and model, with a 'Restore defaults' button.
  • ChatView.tsx uses these settings as fallbacks when creating new threads and resolving the active model/provider.
  • Sidebar.tsx uses appSettings.defaultModel as the default model when creating new projects.

Macroscope summarized aec0916.

Add `defaultModel` and `defaultProvider` fields to app settings so users
can configure the model and provider used for new threads and projects
when no thread-specific or project-level override is set.

- Add `defaultProvider` (optional ProviderKind) and `defaultModel`
  (optional TrimmedNonEmptyString) to the AppSettings schema
- Wire settings into the ChatView provider/model selection hierarchy:
  draft → thread → project → settings default → built-in default
- Update Sidebar project creation to propagate the default model into
  new projects so the setting takes effect immediately
- Add draft-thread model fallback through settings default
- Add "Defaults" section to Settings page with model dropdown
  (provider dropdown conditionally rendered when >1 providers available)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 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: 8da3ee2f-6f73-48e7-9418-91fe3c11617b

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
📝 Coding Plan
  • Generate coding plan for human review comments

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:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Mar 20, 2026
The useCallback for addProjectFromPath captured
appSettings.defaultModel but omitted it from the dependency array,
causing a stale closure when the setting changed without a re-render
triggered by defaultThreadEnvMode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@juliusmarminge
Copy link
Member

#1121 serves the same purpose in a more frictionless way

@binbandit
Copy link
Contributor Author

sure, lets close this then

@binbandit binbandit closed this Mar 20, 2026
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:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants