continue
continue copied to clipboard
Add per-tab model persistence and selection functionality
Description
Persist agent/mode/model per session (not per tab), and load them when switching tabs. This replaces the previous per‑tab persistence so that a session’s settings travel with it, survive IDE restarts, and are consistent across views.
Original PR (for tabs only): https://github.com/continuedev/continue/pull/7617
Discussion: https://github.com/continuedev/continue/discussions/7986
Key changes:
- Session persistence:
- Added optional fields to the session payload:
modeandchatModelTitle. - Persisted to disk in
~/.continue/sessions/<sessionId>.jsonalongside history/title/workspaceDirectory.
- Added optional fields to the session payload:
- Save/Load wiring:
- When saving a session, the GUI includes
modeand the selected chatchatModelTitle. - When loading a session, the GUI:
- Restores
session.modeinto Redux. - Restores the selected chat model from
session.chatModelTitle(when available).
- Restores
- When saving a session, the GUI includes
- Tabs:
- Removed per‑tab model and mode fields and their reducers (
setTabModel,setTabMode). - Switching tabs now relies on the session’s persisted data; no more model/mode mirroring to tabs.
- Removed per‑tab model and mode fields and their reducers (
- Types and plumbing:
- Extended
Sessiontype (core) withmode?andchatModelTitle?. - Updated Core history manager to write/read the new fields when present.
- Extended
Why
- Keeps a conversation’s configuration together and makes it resilient to reloads.
- Eliminates flicker or divergence from tab-local model/mode.
- Paves the way for persisting additional session-level UI state when needed.
Backward compatibility
- Existing session files load normally (new fields are optional).
- Tabs continue to work; they just no longer store model/mode.
AI Code Review
- Team members only: AI review runs automatically when PR is opened or marked ready for review
- Team members can also trigger a review by commenting
@continue-general-reviewor@continue-detailed-review
Checklist
- [X] I've read the contributing guide
- [X] The relevant docs, if any, have been updated or created
- [X] The relevant tests, if any, have been updated or created
Screen recording or screenshot
[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Summary by cubic
Persist session-level chat mode and selected chat model. Switching tabs and loading sessions restore the session’s saved mode and model; new sessions start with the current selection.
- New Features
- Added optional mode and chatModelTitle to Session and persisted them to disk.
- Loading a session sets Redux mode and updates the selected chat model.
- Saving a session writes mode and the selected chat model title.
Written for commit ea6e871db56dadc53b007c70e2b5fdc52332704a. Summary will update automatically on new commits.
@ferenci84 looks like it's still per-tab as opposed to per session, possible PR is on the wrong branch?
@RomneyDa I just didn't push the latest commit. Corrected now.
Great, will take a look!
@ferenci84 I took forever to follow up on this so I went ahead and touched up. Appreciate the contribution!
:tada: This PR is included in version 1.5.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This PR is included in version 1.31.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This PR is included in version 1.35.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This PR is included in version 1.6.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket: