Skip to content

Feature/preserve session on reconnect#627

Merged
NA-Wen merged 1 commit into
OpenBMB:mainfrom
token2everything:feature/preserve-session-on-reconnect
May 26, 2026
Merged

Feature/preserve session on reconnect#627
NA-Wen merged 1 commit into
OpenBMB:mainfrom
token2everything:feature/preserve-session-on-reconnect

Conversation

@token2everything
Copy link
Copy Markdown
Contributor

Summary

  • Decouple WebSocket from session lifecycle: Worker threads no
    longer cancel on disconnect. Workflows keep running even after
    browser refresh or tab close.
  • Message replay on reconnect: All chat messages are buffered
    (ring buffer, max 1000) and replayed to the client upon
    reconnection, restoring full chat history.
  • Session garbage collection: Terminal sessions
    (completed/cancelled/failed) are automatically cleaned up after
    24 hours via background asyncio task.
  • Multi-tab support: Last tab wins — new connections for the same
    session close the old WebSocket and take over.
  • Cancel via message: Clicking "Cancel" now sends an explicit
    cancel message through the WebSocket rather than relying on
    disconnect detection.

@token2everything token2everything force-pushed the feature/preserve-session-on-reconnect branch from 4adf053 to af61c08 Compare May 26, 2026 11:07
… message replay

- Decouple WebSocket connection from session lifecycle: workflows continue running after disconnect
- Message buffering with ring buffer (max 1000) for chat history replay on reconnect
- Session garbage collection: 24-hour TTL for terminal sessions via background asyncio task
- Multi-tab support: last tab wins, old WebSocket closed on new connection for same session
- Cancel now sends explicit WebSocket message instead of relying on disconnect detection
- Replace hardcoded API keys and BASE_URL with ${API_KEY}/${BASE_URL} placeholders in yaml configs
@token2everything token2everything force-pushed the feature/preserve-session-on-reconnect branch from af61c08 to 64bb16a Compare May 26, 2026 11:13
@NA-Wen NA-Wen merged commit ff4d50a into OpenBMB:main May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants