[BUG] [Agent Mode] Chat interface response index mismatch / shift after cross-tab logout-login
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.5k
- Forks
- 4.8k
- PR merge metrics
- No merged PRs in 30d
Description
### **Description:**
There is a critical session desynchronization bug in Agent Mode. When a user has multiple tabs open, logging out of one tab and logging back into it causes the *other* untouched tab to break its message index queue.
Specifically, when the user submits **Prompt N** in the untouched tab, the interface instantly flushes the backend buffer and displays the response intended for **Prompt N-1**.
### **Steps to Reproduce:**
1. Open two separate Agent Mode tabs in the same browser: **Tab 1** and **Tab 2** (both active under the same logged-in account).
2. While on **Tab 1**, click **Log Out**.
3. In that same **Tab 1**, log back into your account. *(Note: During this step, the UI may throw intermittent login error warnings, but authentication eventually succeeds).*
4. Continue the conversation normally inside **Tab 1**.
5. Switch over to **Tab 2** (which was left untouched in the background during the re-authentication process).
6. Send a new prompt (**Prompt 5**) in **Tab 2**.
7. **Observed Behavior:** The system instantly prints out the response meant for the previous turn (**Prompt 4**) instead of processing your new request. The entire message index shifts by -1 turn.
8. Submitting subsequent prompts continues to yield the previous turn's answer. Eventually, the session completely crashes with connection error traces (`Connecting to Arena has failed`, Trace IDs are generated).
### **How to Workaround / Solve it (User perspective):**
The issue can be resolved by completely logging out, closing all stale tabs, clearing the browser site data/cookies for `lmarena.ai`, and logging back in. This forces a complete reset of the broken backend token pool, though the corrupted chat history from the broken thread might be lost.
### **Environment:**
- **Feature:** LMSYS Chatbot Arena (Agent Mode)
- **Root Cause Suspect:** Concurrent session token collision. When a new auth token is generated in Tab 1, older active WebSockets/SSE streams in background tabs fail to invalidate or refresh gracefully, corrupting the backend database chat index buffer for that specific thread.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are identified. Start by reproducing the two-tab Agent Mode logout/login sequence, then trace how the untouched tab handles session tokens and its message queue. Done means new prompts receive their own responses after re-authentication, without stale responses or connection failures.
Written by the indexing model from the issue text.
Assessment
- Domain
- authentication, backend-api-design, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100