Skip to content

Carry the composer's model pick to new sessions - #33

Closed
emircan-sahin wants to merge 1 commit into
hardbeat920:mainfrom
emircan-sahin:fix/sticky-model-choice
Closed

Carry the composer's model pick to new sessions#33
emircan-sahin wants to merge 1 commit into
hardbeat920:mainfrom
emircan-sahin:fix/sticky-model-choice

Conversation

@emircan-sahin

Copy link
Copy Markdown
Contributor

What changed

onModelChange now calls saveLastModelChoice(harness, resolved.id), so switching model from the composer's picker also updates the default new sessions start with.

Why

Fixes #30.

monocode.lastModel was written only by Settings → Providers (SettingsView.tsx). The composer picker updated just the session it was opened from, so defaultSessionChoice() kept reading a stale (or absent) choice and fell back to the hardcoded "cursor" provider — every new session started on Composer regardless of what the user had actually been working in.

The effort/thinking chips sitting next to the picker already do the analogous thing (onModelSettingsChangesaveLastModelSettings), which is why effort was sticky and model was not. This just closes that gap. saveLastModelChoice also writes through to defaultModels[harness], so the per-provider default in Settings tracks the picker too.

UI

No visual change.

Checklist

  • I ran npm run check
  • This PR is small and focused
  • I did not mix unrelated changes

The model picker in the composer only updated the session it was opened
from. `monocode.lastModel` was written solely by Settings -> Providers,
so `defaultSessionChoice()` kept falling back to the built-in default
and every new session started on Composer or Pi regardless of what you
had been working in.

Persist the pick from `onModelChange` too, matching what the effort
controls beside it already do via `saveLastModelSettings`.

Fixes hardbeat920#30
@hardbeat920

Copy link
Copy Markdown
Owner

Thanks for the contribution @emircan-sahin ! I’d like new sessions to keep using the default explicitly chosen in Settings. With this change, selecting a model for an individual chat silently replaces that default, which could be surprising.
I’m closing this for now. Remembering the last selection could still make sense as an optional behavior, but I’d keep it separate from the configured default.

@hardbeat920 hardbeat920 closed this Sep 5, 2026
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.

Default model selection isn't working right!

2 participants