feat(hermes): expose built-in dashboard#4391
Conversation
Signed-off-by: Shannon Sands <shannon.sands.1979@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a baked Hermes browser dashboard and treats it as a first-class UI: builds the web bundle into images, updates manifest/dashboard metadata (auth/health), manages separate dashboard port forwarding and socat forwarders, wires verification probes per-dashboard, returns plain dashboard URLs for session-auth agents, and updates tests/docs. ChangesHermes TUI Dashboard Implementation
Sequence DiagramsequenceDiagram
participant User as User / CLI
participant Start as agents/hermes/start.sh
participant Hermes as hermes CLI
participant Socat as socat
participant Host as Host
User->>Start: onboard sandbox
Start->>Start: resolve ports (API:8642, Dashboard:18789)
Start->>Hermes: launch hermes --tui dashboard (bind to internal ports)
Start->>Socat: start_socat_forwarder Dashboard 18789->DASHBOARD_INTERNAL_PORT
Start->>Socat: start_socat_forwarder API 8642->API_INTERNAL_PORT
Socat->>Host: expose 0.0.0.0:18789 and 0.0.0.0:8642
User->>User: run `nemohermes <name> dashboard-url`
User-->>User: receives http://127.0.0.1:18789/ (plain URL for session-auth agents)
Note over Hermes,Host: verification probes target dashboard and gateway health endpoints separately
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/reference/commands.mdx (1)
471-473: 💤 Low valueConsider clarifying the subject for improved readability.
Lines 472-473 use "this" as the subject. While grammatically correct, explicitly naming "the command" or "the URL" would make these sentences more direct and easier to scan.
✍️ Suggested rewording
Print the browser dashboard URL for a running sandbox. -For OpenClaw sandboxes this includes the authenticated URL fragment. -For agent dashboards that manage their own session, such as Hermes Agent, this prints the plain dashboard URL. +For OpenClaw sandboxes, the command prints the authenticated URL fragment. +For agent dashboards that manage their own session, such as Hermes Agent, the command prints the plain dashboard URL.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/reference/commands.mdx` around lines 471 - 473, Replace the vague pronoun "this" in the two explanatory sentences so the subject is explicit: change "For OpenClaw sandboxes this includes the authenticated URL fragment." to something like "For OpenClaw sandboxes, the command prints the authenticated URL fragment." and change "For agent dashboards that manage their own session, such as Hermes Agent, this prints the plain dashboard URL." to "For agent dashboards that manage their own session, such as Hermes Agent, the command prints the plain dashboard URL." so readers immediately know the subject being described.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/lib/onboard/dashboard.ts`:
- Around line 239-249: The code currently marks a port as stopped in
stoppedPorts before calling bestEffortForwardStopForSandbox; change
stopForwardForSandbox so it first checks stoppedPorts and returns null if
present, then call bestEffortForwardStopForSandbox (using deps.runOpenshell and
the runCapture wrapper) and only if that call indicates success add the portKey
to stoppedPorts and return the result; ensure you treat the specific failure
sentinel (e.g., "list-failed") as a non-success and do not add to stoppedPorts,
preserving the original return value from bestEffortForwardStopForSandbox and
keeping the same parameter names (stopForwardForSandbox, stoppedPorts,
bestEffortForwardStopForSandbox, deps.runOpenshell, deps.runCaptureOpenshell,
sandboxName).
---
Nitpick comments:
In `@docs/reference/commands.mdx`:
- Around line 471-473: Replace the vague pronoun "this" in the two explanatory
sentences so the subject is explicit: change "For OpenClaw sandboxes this
includes the authenticated URL fragment." to something like "For OpenClaw
sandboxes, the command prints the authenticated URL fragment." and change "For
agent dashboards that manage their own session, such as Hermes Agent, this
prints the plain dashboard URL." to "For agent dashboards that manage their own
session, such as Hermes Agent, the command prints the plain dashboard URL." so
readers immediately know the subject being described.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 6239ed9e-6724-467a-9747-c5a4c138d042
📒 Files selected for processing (29)
agents/hermes/Dockerfileagents/hermes/Dockerfile.baseagents/hermes/manifest.yamlagents/hermes/start.shdocs/get-started/quickstart-hermes.mdxdocs/reference/commands.mdxscripts/convert-docs-to-fern.mjssrc/commands/sandbox/dashboard-url.tssrc/lib/agent/base-image.test.tssrc/lib/agent/defs.test.tssrc/lib/agent/defs.tssrc/lib/agent/onboard.test.tssrc/lib/agent/onboard.tssrc/lib/agent/runtime.test.tssrc/lib/dashboard-url-command.test.tssrc/lib/dashboard-url-command.tssrc/lib/dashboard/contract.test.tssrc/lib/dashboard/contract.tssrc/lib/inference/local.test.tssrc/lib/inference/local.tssrc/lib/onboard.tssrc/lib/onboard/dashboard.tssrc/lib/verify-deployment.test.tssrc/lib/verify-deployment.tstest/cli.test.tstest/hermes-start.test.tstest/onboard-dashboard.test.tstest/onboard.test.tstest/sandbox-provisioning.test.ts
Signed-off-by: Shannon Sands <shannon.sands.1979@gmail.com>
|
✨ Thanks for submitting this detailed PR that exposes the Hermes Agent built-in dashboard as NemoClaw's browser surface. This proposes a way to improve the onboarding experience by providing a built-in dashboard and updates the documentation to reflect the changes. |
## Summary This PR salvages #4391 by rebasing the Hermes dashboard work onto current `main`, resolving conflicts narrowly, and keeping the change focused on exposing Hermes' built-in dashboard while preserving the OpenAI-compatible API on port 8642. It also prebuilds Hermes dashboard assets in the sandbox image so `hermes dashboard` does not run `npm` as the sandbox user under `/opt/hermes`. ## Related Issue Salvages #4391. Related: #4764. ## Changes - Exposes the Hermes built-in dashboard as the browser surface on port `18789` while keeping the OpenAI-compatible API forward on port `8642`. - Prebuilds Hermes dashboard assets in `agents/hermes/Dockerfile.base` and the final Hermes image fallback path, then starts `hermes dashboard --skip-build` at runtime. - Updates dashboard URL, deployment verification, and onboarding forward logic for separate dashboard/API health probes and session-authenticated Hermes dashboard URLs. - Updates Hermes quickstart/command docs and tests for dashboard behavior, prebuilt assets, forwards, and guardrail-friendly onboarding changes. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [x] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Verification - [x] `npx prek run --all-files` passes - [ ] `npm test` passes - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [x] Docs updated for user-facing behavior changes - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) Additional validation run: - `npm run build:cli` passes - `npm run typecheck:cli` passes - Focused Vitest for changed Hermes/dashboard/onboard/provisioning paths passes - `npm run source-shape:check` passes - Local codebase-growth guardrail simulation passes (`src/lib/onboard.ts` net -1; no newly added JS files) `npm test` was attempted, but one existing installer preflight test failed in this local host environment (`warns on Podman but still runs onboarding`) because the host reports missing NVIDIA CDI specs and sudo is unavailable; this is outside the Hermes dashboard diff. --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Built-in Hermes web dashboard is now the primary interface (default port 18789) and ships with prebuilt assets for faster startup. * CLI dashboard-url now prints a plain browser-facing dashboard URL for Hermes. * **Bug Fixes / Reliability** * Improved dashboard/gateway port validation, collision handling, and health-checking for more reliable sandbox startup and forwarding. * **Documentation** * Quickstart and reference docs updated to reflect dashboard-first UX and separate API endpoint. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Shannon Sands <shannon.sands.1979@gmail.com> Signed-off-by: Carlos Villela <cvillela@nvidia.com> Co-authored-by: Shannon Sands <shannon.sands.1979@gmail.com>
Summary
Expose the Hermes Agent built-in dashboard as NemoClaw's browser surface and keep the OpenAI-compatible API on its existing route. The image now prebakes Hermes dashboard assets and exports
HERMES_WEB_DISTsohermes dashboardworks inside the sandbox without trying to run npm at runtime.Changes
HERMES_WEB_DISTfor service and connect shells.Type of Change
Verification
Focused checks run:
npm run build:cli;git diff --check;npx vitest run test/sandbox-provisioning.test.ts test/hermes-start.test.ts test/onboard-dashboard.test.ts src/lib/dashboard/contract.test.ts src/lib/dashboard-url-command.test.ts src/lib/verify-deployment.test.ts src/lib/agent/defs.test.ts src/lib/agent/onboard.test.ts src/lib/agent/runtime.test.ts test/onboard.test.ts --maxWorkers=1 --testTimeout=30000; local rebuild/smoke ofnemohermes hermes rebuild --yes --verbose; in-sandboxhermes dashboardsmoke.npx prek run --all-filespassesnpm testpassesnpm run docsbuilds without warnings (doc changes only)Signed-off-by: Shannon Sands shannon.sands.1979@gmail.com
Summary by CodeRabbit
New Features
Behavior Changes
Documentation
Tests