continue icon indicating copy to clipboard operation
continue copied to clipboard

Prevent going back to previous session when changing modes on a new initialized session

Open uinstinct opened this issue 6 months ago • 1 comments

Description

This happens when we change the modes. Currently when we open a new session by clicking on the new session button, we go back to the previous session as we change mode from edit to chat/agent.

This should not happen because the user explicitly asked for a new chat session.

This PR fixes this by tracking when a new session was explicitly initialized then we do not go back to previous sessions on any mode change.

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

Screenshots

https://github.com/user-attachments/assets/cb9f49a9-d6f8-46b6-ac8a-0012608e5a81

https://github.com/user-attachments/assets/f5e80ba4-fecd-476f-a1a7-771dd00006e1

Testing instructions

  1. Click on a new chat session plus button on the top right.
  2. Change the mode to edit.
  3. Now change the mode to chat or agent.
  4. See that new session is preserved without going back to the previous session unexpectedly.

uinstinct avatar Apr 25 '25 04:04 uinstinct