OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: Multiple tabs going to server from the same browser re-uses the same session ID

Open diwu-sf opened this issue 1 year ago • 4 comments

Is there an existing issue for the same bug?

  • [X] I have checked the existing issues.

Describe the bug and reproduction steps

The session is stored in local storage, so if a second tab is opened to http://localhost:3000/app while a session already is running, the websockets start sending data to the new tab and the old tab is broken.

Overall, it's just an awful experience and the app only really works if there's a single tab active.

OpenHands Installation

Docker command in README

OpenHands Version

No response

Operating System

None

Logs, Errors, Screenshots, and Additional Context

No response

diwu-sf avatar Nov 03 '24 06:11 diwu-sf

Hmmm yeah you cannot have multiple conversations going. There are issues open to allow that. Wondering if this is a bug or an enhancement request.

When you open the second tab, does it have all the conversation context and you can see the full chat? Or does it start from the beginning?

mamoodi avatar Nov 04 '24 01:11 mamoodi

It actually doesn't, that's why I thought it would be a bug, since my expectation would be:

  • either it grab the full chat conversation from the previous on every tab, and every tab is able to the same eventstream and UI state is the same
  • OR, each tab is a new session, independent of each other (different SID on the backend)

What I observe instead is that the tabs share the same SID (due to localstorage i think) but they don't load up the same conversation, and often the tabs just show blank. If the tabs all end up showing and streaming from the same SID that'd be an okay behavior until multi-session is in-place.

I also think it's cleaner if it wasn't using local-storage for SID persistence and instead just go off of a query-param, which would make it clear what session is loaded / connected in each tab.

diwu-sf avatar Nov 04 '24 01:11 diwu-sf

Hmmmm yeah this is going to be tricky. I just tried this and I get a weird behavior. It retained the history and context but it didn't keep the workspace and only the new tab works. Yeah we should rethink this. CC @rbren , @amanape

mamoodi avatar Nov 04 '24 01:11 mamoodi

Hmm multi-conversation support is on our roadmap for sure, but explicitly not supported today

That said, you should be able to view the same conversation in multiple tabs... 👀

rbren avatar Nov 04 '24 16:11 rbren

This is fixed in the latest release

mamoodi avatar Nov 13 '24 21:11 mamoodi