Skip to content

Conversation

uinstinct
Copy link
Contributor

@uinstinct uinstinct commented Sep 24, 2025

Description

Remove session reducer's history item from redux's persistent storage which was stored in vscode's session storage (having cases exceeding 5mb limit).

closes CON-3773

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-review or @continue-detailed-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] 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

Removed persisting chat history in Redux to VS Code session storage to avoid hitting the 5 MB limit and prevent errors on large sessions. Closes CON-3773.

  • Bug Fixes

    • Stop persisting session.history and remove its migration so history is no longer saved or rehydrated.
  • Refactors

    • Remove unused redux-logger import and setup from the store.

@uinstinct uinstinct requested a review from a team as a code owner September 24, 2025 16:17
@uinstinct uinstinct requested review from RomneyDa and removed request for a team September 24, 2025 16:17
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Sep 24, 2025
Copy link
Collaborator

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

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

@uinstinct when I tried this earlier it caused failure to load last session, do we need to add loading of last session on startup from JSON?

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Sep 24, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Sep 25, 2025
@uinstinct
Copy link
Contributor Author

@uinstinct when I tried this earlier it caused failure to load last session, do we need to add loading of last session on startup from JSON?

I see. There is a slight delay on the first load.
Added a loading indicator!

feat.mp4

@uinstinct uinstinct requested a review from RomneyDa September 25, 2025 12:27
@RomneyDa
Copy link
Collaborator

RomneyDa commented Sep 25, 2025

@uinstinct I mean on startup it won't load the last session like it currently does. The last session button would operate as before

Copy link
Collaborator

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

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

See above comments

@uinstinct
Copy link
Contributor Author

feat.mp4

implemented!

@uinstinct uinstinct requested a review from RomneyDa September 26, 2025 06:31
export function setupStore(options: { ideMessenger?: IIdeMessenger }) {
const ideMessenger = options.ideMessenger ?? new IdeMessenger();

const logger = createLogger({
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can be used if you uncomment the .concat(logger) below. For debugging

createFilter("session", [
"history",
"id",
"lastSessionId",
Copy link
Collaborator

Choose a reason for hiding this comment

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

We still need to persist lastSessionId

async (_, { extra, dispatch, getState }) => {
let lastSessionId = getState().session.lastSessionId;

const lastSessionResult = await extra.ideMessenger.request("history/list", {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would just used persisted lastSessionId still rather than listing history. If there's noLast sessionId we start a new session

Copy link
Collaborator

Choose a reason for hiding this comment

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

That being said might just comment it out since we will want some version of this soon for per-workspace sessions!

}, []);

useEffect(() => {
void dispatch(loadLastSession());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this is pretty critical loading could we add some retry logic and error handling? Maybe retry with exponential backoff or a few times or similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants