feat(chat): remember model and effort choices, keep effort across model switches#875
feat(chat): remember model and effort choices, keep effort across model switches#875matt2e wants to merge 1 commit into
Conversation
…el switches Persist each provider's last explicitly chosen model and effort valueIds under a new acp-config-prefs store key, and restore them in the agent config picker once discovery lands: a persisted model still offered by the selector is re-selected (kicking off model-specific effort discovery when it differs from the default), and a persisted effort is applied whenever an effort selector arrives without a valid explicit selection. Restored values are marked explicit so they are actually sent at launch; ids no longer offered fall back silently to defaults. Switching models no longer discards the effort selection. Both the picker and the session follow-up composer now hold the current effort as a desired value while model-specific options load, then reconcile: keep it when the new options still offer it, otherwise fall back to the selector default (picker: via the persisted preference first). Follow-up model/effort changes also record the preference. The reconciliation lives in a shared reconcileSelectorValue helper in acpConfigSelection.ts, and the pref merge in a pure acpConfigPrefs module; both are unit-tested. Verified with vitest (424 passing) and svelte-check/tsc (clean). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80ffa4caec
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // The effort selection is kept as the desired value; the effort effect | ||
| // reconciles it once the model-specific options arrive. |
There was a problem hiding this comment.
Keep follow-up effort explicit across model switches
When a user replies to an existing session that already has an effort selected, then changes only the follow-up model to another model that still offers that effort, this code keeps showing the old effort value but leaves followupEffortTouched false. In that state followupAcpConfigSelection passes null as the stored effort for model-specific configs, so buildAcpConfigSelection omits the effort and resumeSession receives a model-only requested selection, clearing/not applying the displayed effort. Mark the retained valid effort as explicit or avoid displaying it as selected unless it will be sent.
Useful? React with 👍 / 👎.
Summary
Makes the agent config pickers remember what the user last chose, and stops model switches from discarding the effort selection.
acp-config-prefspreferences store, keyed by provider id. Only selector valueIds are stored — labels always come from live discovery, so stale ids fall back silently rather than surfacing broken options.AcpConfigPickerfinishes discovery, the persisted model is re-applied if the provider still offers it (marked explicit so it's actually sent at launch), and the model-specific effort options are fetched for it.reconcileSelectorValuehelper — kept if still offered, otherwise falling back to the selector default as display-only. The same behavior applies to the follow-up effort picker inSessionChatPane.Implementation notes
defaultSelectorValue/selectorHasValuemoved out ofAcpConfigPicker.svelteintoacpConfigSelection.tsso they can be shared and unit-tested.acpConfigPrefs.tsmodule (separate frompreferences.svelte.tsso it's testable without the Svelte runtime); patches update fields independently andnullclears one.Testing
reconcileSelectorValue(kept/fallback/empty-selector cases) andmergeAcpConfigPref(create/update/clear/no-mutation).🤖 Generated with Claude Code