Skip to content

feat(chat): remember model and effort choices, keep effort across model switches#875

Open
matt2e wants to merge 1 commit into
mainfrom
level-of-effort-clean-up
Open

feat(chat): remember model and effort choices, keep effort across model switches#875
matt2e wants to merge 1 commit into
mainfrom
level-of-effort-clean-up

Conversation

@matt2e

@matt2e matt2e commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes the agent config pickers remember what the user last chose, and stops model switches from discarding the effort selection.

  • Per-provider persistence. Explicit model/effort choices in the session composer and follow-up pickers are saved to a new acp-config-prefs preferences 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.
  • Restore on discovery. When the AcpConfigPicker finishes 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.
  • Effort survives model switches. Previously, changing the model reset the effort selection to the default. Now the current effort is retained as the desired value and reconciled against the incoming model-specific options via a new reconcileSelectorValue helper — kept if still offered, otherwise falling back to the selector default as display-only. The same behavior applies to the follow-up effort picker in SessionChatPane.

Implementation notes

  • defaultSelectorValue / selectorHasValue moved out of AcpConfigPicker.svelte into acpConfigSelection.ts so they can be shared and unit-tested.
  • Pref merge logic lives in a new acpConfigPrefs.ts module (separate from preferences.svelte.ts so it's testable without the Svelte runtime); patches update fields independently and null clears one.
  • Remote agents are excluded from persistence.

Testing

  • New unit tests for reconcileSelectorValue (kept/fallback/empty-selector cases) and mergeAcpConfigPref (create/update/clear/no-mutation).

🤖 Generated with Claude Code

…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>
@matt2e matt2e requested review from baxen and wesbillman as code owners July 11, 2026 05:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +1408 to +1409
// The effort selection is kept as the desired value; the effort effect
// reconciles it once the model-specific options arrive.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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