hermes - 💡(How to fix) Fix [Feature]: Persistent agent sessions — tasks should continue when webchat browser tab is closed

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

This contrasts with messaging platform adapters (Telegram, Discord, Slack), where the agent continues working even if the user's client temporarily disconnects — because those platforms decouple the agent's execution from the client's connection state.

RAW_BUFFERClick to expand / collapse

Problem or Use Case

When using Hermes Agent via the webchat interface (dashboard/browser), closing the browser tab causes the WebSocket connection to drop. This disconnection triggers an interrupt signal to the agent, which stops the currently running task. Tasks do NOT continue running in the background — they are terminated mid-execution.

This is a significant usability issue:

  • A user kicks off a complex multi-step task (research, code generation, file processing) via the dashboard
  • They accidentally close the tab, the browser crashes, or their network briefly drops
  • The agent receives an interrupt signal, abandons the task, and all progress is lost
  • Reconnecting shows a fresh session with no record of what was happening

This contrasts with messaging platform adapters (Telegram, Discord, Slack), where the agent continues working even if the user's client temporarily disconnects — because those platforms decouple the agent's execution from the client's connection state.

Current behavior:

  1. Open the Hermes dashboard (webchat)
  2. Send a message that triggers a long-running agent task
  3. Close the browser tab
  4. Reopen the dashboard → task is gone, agent received interrupt, no output preserved

Proposed Solution

1. Persistent Agent Sessions (Core Fix)

The agent's task execution should be decoupled from the WebSocket connection lifecycle. When a WebSocket disconnects:

  • The agent should not receive an interrupt signal just because the client disconnected
  • The agent should continue executing the current task in the background
  • Task state and results should be persisted
  • A session_id should survive disconnection and be re-attachable

2. Auto-Reconnect with History Replay

When a user reopens the dashboard tab or reconnects:

  • The frontend should auto-reconnect to the existing session_id
  • Upon reconnection, display all messages/events that occurred during disconnection
  • Show a reconnect banner like "Reconnected — 3 messages received while away"

3. "Run in Background" Explicit UI Option

  • A "Run in background" / "Detach" button next to the send button
  • When clicked, the task is explicitly marked as running independently of the connection
  • A "Background Tasks" panel showing detached tasks with status (running/completed/failed)
  • Clicking a background task shows its full output

Alternatives Considered

  • Keep-alive pings only — doesn't solve tab-close or browser crash scenarios
  • Browser notifications — could complement persistent sessions via Web Push API to notify when a background task completes
  • CLI-only for long tasks — defeats the purpose of having a rich web UI; the dashboard should be a first-class way to interact with the agent

Feature Type

Gateway / messaging improvement

Scope

Large (new module or significant refactor)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING