-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add per-tab model persistence and selection functionality #8644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…tches and session loads
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 2 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="gui/src/redux/slices/tabsSlice.ts">
<violation number="1" location="gui/src/redux/slices/tabsSlice.ts:46">
This PR's implementation contradicts its stated architectural goal. It re-introduces per-tab state management for model and mode (in `tabsSlice.ts`) instead of removing it, and the logic in `TabBar.tsx` incorrectly uses this tab-level state as the source of truth, overriding the intended session-level persistence.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
gui/src/redux/slices/tabsSlice.ts
Outdated
| ); | ||
| }, | ||
| // Set the model title for a specific tab | ||
| setTabModel: ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR's implementation contradicts its stated architectural goal. It re-introduces per-tab state management for model and mode (in tabsSlice.ts) instead of removing it, and the logic in TabBar.tsx incorrectly uses this tab-level state as the source of truth, overriding the intended session-level persistence.
Prompt for AI agents
Address the following comment on gui/src/redux/slices/tabsSlice.ts at line 46:
<comment>This PR's implementation contradicts its stated architectural goal. It re-introduces per-tab state management for model and mode (in `tabsSlice.ts`) instead of removing it, and the logic in `TabBar.tsx` incorrectly uses this tab-level state as the source of truth, overriding the intended session-level persistence.</comment>
<file context>
@@ -37,6 +42,26 @@ export const tabsSlice = createSlice({
);
},
+ // Set the model title for a specific tab
+ setTabModel: (
+ state,
+ action: PayloadAction<{ id: string; modelTitle: string }>,
</file context>
✅ Addressed in a3b5ee8
RomneyDa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 6 files
|
Great, will take a look! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean implementation!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed the same logic is duplicated, could we move it to the newSession action instead?
…erenci84/per-tab-model-persistence
|
@ferenci84 I took forever to follow up on this so I went ahead and touched up. Appreciate the contribution! |
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): #7617
Discussion: #7986
Key changes:
modeandchatModelTitle.~/.continue/sessions/<sessionId>.jsonalongside history/title/workspaceDirectory.modeand the selected chatchatModelTitle.session.modeinto Redux.session.chatModelTitle(when available).setTabModel,setTabMode).Sessiontype (core) withmode?andchatModelTitle?.Why
Backward compatibility
AI Code Review
@continue-general-reviewor@continue-detailed-reviewChecklist
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.
Written for commit 4b330de. Summary will update automatically on new commits.