Skip to content

fix(ui): sync model preference into store on startup#350

Merged
dimakis merged 1 commit into
mainfrom
fix/model-preference-sync
May 22, 2026
Merged

fix(ui): sync model preference into store on startup#350
dimakis merged 1 commit into
mainfrom
fix/model-preference-sync

Conversation

@dimakis
Copy link
Copy Markdown
Owner

@dimakis dimakis commented May 22, 2026

Summary

  • The Zustand store initialized config.modelId as null while the UI dropdown read the preference from localStorage
  • sendMessage() reads from the store, so the model field was never included in the WS payload — the SDK silently fell back to Sonnet
  • One-line fix: call setModel(getPreferredModel()) after store creation to sync localStorage into the store

Selected model now persists across all sessions until the dropdown is changed.

Test plan

  • Select Opus in dropdown, send a message — verify commit Co-Authored-By says Opus
  • Reload the app without touching the dropdown — verify the model still sends correctly
  • Change to Sonnet, send a message — verify it switches
  • Change back to Opus — verify it persists on next session

🤖 Generated with Claude Code

The Zustand store initialized config.modelId as null while the UI
dropdown read from localStorage. sendMessage() used the store value,
so the model field was never sent — the SDK fell back to Sonnet.

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

@dimakis dimakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Centaur Review

LGTM — no issues found.

@dimakis dimakis merged commit a61ca74 into main May 22, 2026
1 check passed
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