Skip to content

fix(cli): warn about stale dashboard processes after hermes update#16881

Closed
Societus wants to merge 1 commit into
NousResearch:mainfrom
Societus:fix/warn-stale-dashboard-after-update
Closed

fix(cli): warn about stale dashboard processes after hermes update#16881
Societus wants to merge 1 commit into
NousResearch:mainfrom
Societus:fix/warn-stale-dashboard-after-update

Conversation

@Societus

Copy link
Copy Markdown
Contributor

Fixes #16872

What

After a successful update, scan the process table for running hermes dashboard processes and print a warning with their PIDs and restart instructions. Mirrors the existing pattern for gateway processes (lines 6809-7135 in main.py).

The dashboard is a long-lived server process users start and forget. Unlike the gateway (auto-restart via systemd/launchd), the dashboard has no service manager. It runs as a bare nohup or background process. When hermes update replaces files on disk, the running process holds the old Python code in memory while the JS bundle on disk gets updated, producing a silent frontend/backend mismatch.

Changes

  • hermes_cli/main.py: Add _warn_stale_dashboard_processes() that scans for dashboard processes via pgrep (Linux/macOS) or wmic (Windows), called at the end of both _cmd_update_impl (git path) and _update_via_zip (zip path).
  • tests/hermes_cli/test_update_stale_dashboard.py: Tests for the warning: fires when dashboard PIDs exist, silent when none found, self-PID excluded, errors handled without crashing.

How to test

  1. Start hermes dashboard --port 9119 --no-open in a terminal
  2. In another terminal, run hermes update (or the test suite)
  3. Observe the warning message with the PID
  4. Verify no warning when no dashboard is running

The dashboard is a long-lived server process users start and forget.
When hermes update replaces files on disk, the running process holds
the old Python backend in memory while the JS bundle gets updated,
producing a silent frontend/backend mismatch (e.g. v0.11.0 changed
the session token header -- old backends reject every API call).

Scan for running dashboard processes after a successful update (both
git and ZIP paths) and print a warning with their PIDs and restart
instructions. Mirrors the existing pattern for gateway processes.

Fixes NousResearch#16872
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 28, 2026
teknium1 added a commit that referenced this pull request Apr 28, 2026
Replace the Linux/macOS pgrep regex ("hermes.*dashboard") with a ps
scan + the same explicit patterns list already used on the Windows
branch and in hermes_cli.gateway._scan_gateway_pids:

    hermes dashboard
    hermes_cli.main dashboard
    hermes_cli/main.py dashboard

The old greedy regex would match any cmdline containing both words —
e.g. a chat session whose argv mentions "dashboard" or an unrelated
grafana/dashboard-server process. Added regression tests for both.

Follow-up tightening on #16881.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #16895. Your commit was cherry-picked onto current main with authorship preserved (commit 66b1142), plus a follow-up tightening commit that replaced the Linux pgrep -f "hermes.*dashboard" regex with a ps scan using the same explicit patterns list already on the Windows branch and in hermes_cli.gateway._scan_gateway_pids — the original regex would also match unrelated cmdlines containing both words (e.g. a chat session mentioning "dashboard", or a grafana process). Thanks for the fix and the clear repro in #16872!

cluricaun28 referenced this pull request in cluricaun28/Logos Apr 28, 2026
Replace the Linux/macOS pgrep regex ("hermes.*dashboard") with a ps
scan + the same explicit patterns list already used on the Windows
branch and in hermes_cli.gateway._scan_gateway_pids:

    hermes dashboard
    hermes_cli.main dashboard
    hermes_cli/main.py dashboard

The old greedy regex would match any cmdline containing both words —
e.g. a chat session whose argv mentions "dashboard" or an unrelated
grafana/dashboard-server process. Added regression tests for both.

Follow-up tightening on #16881.
@PHclaw

PHclaw commented Apr 29, 2026

Copy link
Copy Markdown

For the memory corruption in long sessions:

The fix involves implementing a ring buffer for memory:

from collections import deque

class RingMemory:
    def __init__(self, max_size=100):
        self.buffer = deque(maxlen=max_size)
    
    def add(self, item):
        self.buffer.append(item)
    
    def get_recent(self, n=10):
        return list(self.buffer)[-n:]
    
    def get_all(self):
        return list(self.buffer)
    
    def clear(self):
        self.buffer.clear()

This prevents unbounded memory growth while keeping the most recent items.

ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
Replace the Linux/macOS pgrep regex ("hermes.*dashboard") with a ps
scan + the same explicit patterns list already used on the Windows
branch and in hermes_cli.gateway._scan_gateway_pids:

    hermes dashboard
    hermes_cli.main dashboard
    hermes_cli/main.py dashboard

The old greedy regex would match any cmdline containing both words —
e.g. a chat session whose argv mentions "dashboard" or an unrelated
grafana/dashboard-server process. Added regression tests for both.

Follow-up tightening on NousResearch#16881.
donald131 pushed a commit to donald131/hermes-agent that referenced this pull request May 2, 2026
Replace the Linux/macOS pgrep regex ("hermes.*dashboard") with a ps
scan + the same explicit patterns list already used on the Windows
branch and in hermes_cli.gateway._scan_gateway_pids:

    hermes dashboard
    hermes_cli.main dashboard
    hermes_cli/main.py dashboard

The old greedy regex would match any cmdline containing both words —
e.g. a chat session whose argv mentions "dashboard" or an unrelated
grafana/dashboard-server process. Added regression tests for both.

Follow-up tightening on NousResearch#16881.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
Replace the Linux/macOS pgrep regex ("hermes.*dashboard") with a ps
scan + the same explicit patterns list already used on the Windows
branch and in hermes_cli.gateway._scan_gateway_pids:

    hermes dashboard
    hermes_cli.main dashboard
    hermes_cli/main.py dashboard

The old greedy regex would match any cmdline containing both words —
e.g. a chat session whose argv mentions "dashboard" or an unrelated
grafana/dashboard-server process. Added regression tests for both.

Follow-up tightening on NousResearch#16881.
dannyJ848 pushed a commit to dannyJ848/hermes-agent that referenced this pull request May 17, 2026
Replace the Linux/macOS pgrep regex ("hermes.*dashboard") with a ps
scan + the same explicit patterns list already used on the Windows
branch and in hermes_cli.gateway._scan_gateway_pids:

    hermes dashboard
    hermes_cli.main dashboard
    hermes_cli/main.py dashboard

The old greedy regex would match any cmdline containing both words —
e.g. a chat session whose argv mentions "dashboard" or an unrelated
grafana/dashboard-server process. Added regression tests for both.

Follow-up tightening on NousResearch#16881.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Replace the Linux/macOS pgrep regex ("hermes.*dashboard") with a ps
scan + the same explicit patterns list already used on the Windows
branch and in hermes_cli.gateway._scan_gateway_pids:

    hermes dashboard
    hermes_cli.main dashboard
    hermes_cli/main.py dashboard

The old greedy regex would match any cmdline containing both words —
e.g. a chat session whose argv mentions "dashboard" or an unrelated
grafana/dashboard-server process. Added regression tests for both.

Follow-up tightening on NousResearch#16881.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
Replace the Linux/macOS pgrep regex ("hermes.*dashboard") with a ps
scan + the same explicit patterns list already used on the Windows
branch and in hermes_cli.gateway._scan_gateway_pids:

    hermes dashboard
    hermes_cli.main dashboard
    hermes_cli/main.py dashboard

The old greedy regex would match any cmdline containing both words —
e.g. a chat session whose argv mentions "dashboard" or an unrelated
grafana/dashboard-server process. Added regression tests for both.

Follow-up tightening on NousResearch#16881.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hermes update doesn't warn about stale dashboard processes (frontend/backend version mismatch)

4 participants