Skip to content

fix(serve): emit both HERMES_DASHBOARD_READY and HERMES_BACKEND_READY for backward compatibility - #60763

Open
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-60412
Open

fix(serve): emit both HERMES_DASHBOARD_READY and HERMES_BACKEND_READY for backward compatibility#60763
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-60412

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

What does this PR do?

After PR #55923, hermes serve --headless (used by desktop app spawn) emits HERMES_BACKEND_READY port=N instead of the legacy HERMES_DASHBOARD_READY port=N. The desktop regex was updated in the same PR to match either sentinel, but this only takes effect when the Electron app is rebuilt and reinstalled.

Users who run hermes update (CLI-only) get the new sentinel emission without the updated regex consumer, causing port discovery to timeout and the desktop to fail to connect.

This PR ensures backward compatibility by emitting both sentinels during the transition period.

Related Issue

Fixes #60412

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

How to Test

  1. Start hermes serve --headless --port 0
  2. Observed result: stdout now contains both sentinel lines:
    HERMES_DASHBOARD_READY port=54321
    HERMES_BACKEND_READY port=54321
      Hermes backend listening on 127.0.0.1:54321
    
  3. The desktop regex const _READY_RE = /^HERMES_(?:BACKEND|DASHBOARD)_READY port=(\d+)/m (added in feat(cli): make hermes serve a real headless backend (no web UI build/mount, neutral ready sentinel) #55923) already matches either sentinel, so post-feat(cli): make hermes serve a real headless backend (no web UI build/mount, neutral ready sentinel) #55923 desktop builds will correctly parse port=54321 from either line
  4. Pre-feat(cli): make hermes serve a real headless backend (no web UI build/mount, neutral ready sentinel) #55923 desktop builds with the old regex /^HERMES_DASHBOARD_READY port=(\d+)/m will correctly parse from the first line, avoiding the timeout issue
  5. No desktop-side code changes required — this is a CLI-only fix that unblocks the existing compatibility path

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15.2

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

… for backward compatibility

After PR NousResearch#55923, `hermes serve --headless` (used by desktop app spawn) emits
`HERMES_BACKEND_READY port=N` instead of the legacy `HERMES_DASHBOARD_READY port=N`.
The desktop regex was updated in the same PR to match either sentinel, but this
only takes effect when the Electron app is rebuilt and reinstalled.

Users who run `hermes update` (CLI-only) get the new sentinel emission without the
updated regex consumer, causing port discovery to timeout and the desktop to fail
to connect.

Fix: Emit both sentinels during the transition period. This ensures:
- Pre-NousResearch#55923 desktop builds match `HERMES_DASHBOARD_READY`
- Post-NousResearch#55923 desktop builds match `HERMES_BACKEND_READY`
- The ready-file side channel (HERMES_DESKTOP_READY_FILE) remains as fallback

No test changes needed — the desktop regex already matches either sentinel since
NousResearch#55923, and the ready-file path is unaffected.
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard comp/dashboard Web dashboard / control panel UI (dashboard/, landing) P2 Medium — degraded but workaround exists sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 8, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for addressing the independently deployed desktop/CLI compatibility path. The premise is confirmed on current main: hermes_cli/web_server.py:17065 emits only HERMES_BACKEND_READY for headless=True, while the pre-#55923 desktop parser at f0f8c84d1^:apps/desktop/electron/backend-ready.cjs:3 accepted only HERMES_DASHBOARD_READY; that bundle already launched serve (f0f8c84d1^:apps/desktop/electron/main.cjs:1345-1401).

Problems

  • This PR changes the ready-line compatibility contract but adds no regression test. Current Electron tests verify the consumer accepts both tokens (apps/desktop/electron/backend-ready.test.ts:87-98), not that the Python producer emits the legacy line for a headless desktop-compatible launch.

Suggested changes

Automated hermes-sweeper review.

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 comp/dashboard Web dashboard / control panel UI (dashboard/, landing) P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: hermes serve headless refactor (#55923) breaks desktop app launch — port discovery sentinel mismatch after hermes update

3 participants