Skip to content

fix(hermes): detect wrapped gateway argv - #5168

Merged
cv merged 1 commit into
mainfrom
fix-4981-hermes-real-detection
Jun 10, 2026
Merged

fix(hermes): detect wrapped gateway argv#5168
cv merged 1 commit into
mainfrom
fix-4981-hermes-real-detection

Conversation

@jyaunches

@jyaunches jyaunches commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Verification

  • npm test -- --run test/hermes-start.test.ts
  • bash -n agents/hermes/start.sh
  • bash -n test/e2e/test-hermes-root-entrypoint-smoke.sh
  • git diff --check origin/main...HEAD

Refs #4981

Summary by CodeRabbit

  • Improvements
    • Extended Hermes gateway process detection to recognize additional invocation variants, improving health monitoring accuracy and cleanup operation reliability across deployment scenarios.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 13666b5c-5abe-41bb-9bab-43a6f01ff68a

📥 Commits

Reviewing files that changed from the base of the PR and between e1240df and 1ee96a9.

📒 Files selected for processing (3)
  • agents/hermes/start.sh
  • test/e2e/test-hermes-root-entrypoint-smoke.sh
  • test/hermes-start.test.ts

📝 Walkthrough

Walkthrough

The PR extends Hermes gateway process detection to recognize hermes.real gateway run invocations alongside existing hermes gateway run patterns. The core detection logic is updated in the startup script, and test infrastructure is parameterized to validate the new detection variant with a new unit test case and updated smoke test assertions.

Changes

Gateway Detection Expansion

Layer / File(s) Summary
Detection logic expansion
agents/hermes/start.sh
The cmdline_is_hermes_gateway function's case pattern matching is extended to also match hermes.real gateway run commandlines, broadening the detection of active Hermes gateway processes.
Test infrastructure and validation
test/hermes-start.test.ts, test/e2e/test-hermes-root-entrypoint-smoke.sh
The test harness options type adds an optional liveGatewayArgv field to parameterize mocked gateway process commands. The mocked cmdline now uses this field (defaulting to the prior hardcoded value). A new unit test case verifies cleanup preserves runtime state when the gateway's argv indicates it exec'd hermes.real. The smoke test's awk pattern is updated to recognize both gateway invocation variants.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested Labels

bug-fix

Suggested Reviewers

  • prekshivyas

Poem

A gateway in two forms now found,
hermes.real and classic sound,
Detection grows to match them all,
Tests dance where cleanup calls,
Runtime state stays safe and sound. 🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and concisely describes the main change: detecting wrapped gateway argv (hermes.real) in addition to the standard hermes gateway invocation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-4981-hermes-real-detection

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 0 needs attention, 0 worth checking, 0 nice ideas

Consider writing more tests for
  • **Runtime validation** — Hermes root-entrypoint runtime with wrapper execs `hermes.real gateway run` preserves gateway PID/lock and does not kill active socat forwarders.. The changed surface is sandbox lifecycle startup/cleanup logic. The shell-fixture unit regression is focused and appropriate, and a targeted runtime validation remains useful for this infrastructure path.

Workflow run details

This is an automated advisory review. A human maintainer must make the final merge decision.

@github-actions

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: hermes-root-entrypoint-smoke-e2e
Optional E2E: hermes-secret-boundary-e2e, hermes-e2e

Dispatch hint: hermes-root-entrypoint-smoke-e2e

Auto-dispatched E2E: hermes-root-entrypoint-smoke-e2e via nightly-e2e.yaml at 1ee96a9dd7989ae9e2b92d8f79cc7e92506b5a74nightly run

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • hermes-root-entrypoint-smoke-e2e (medium): Direct coverage for the changed Hermes root entrypoint/startup path. It builds/runs the Hermes production container, waits for health, verifies the gateway process under the gateway user, checks runtime layout repair, and exercises legacy stale PID/symlink migration behavior affected by live gateway detection.

Optional E2E

  • hermes-secret-boundary-e2e (medium): Adjacent confidence for Hermes startup security boundaries because agents/hermes/start.sh is also responsible for locked config and secret-boundary enforcement, though the diff only changes process detection.
  • hermes-e2e (high): Optional full Hermes assistant smoke to validate end-to-end Hermes onboarding/runtime still works after changing startup cleanup behavior.

New E2E recommendations

  • None.

Dispatch hint

  • Workflow: .github/workflows/nightly-e2e.yaml
  • jobs input: hermes-root-entrypoint-smoke-e2e

@github-actions

Copy link
Copy Markdown
Contributor

E2E Scenario Advisor Recommendation

Required scenario E2E: None
Optional scenario E2E: None

Workflow run

Full scenario advisor summary

E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required scenario E2E

  • None. No Vitest scenario E2E is recommended. The PR changes Hermes entrypoint/runtime cleanup behavior and non-scenario tests, but the live-supported typed Vitest scenario set on the trusted checkout only wires cloud-openclaw scenarios; Hermes registry scenarios exist but are not live-supported. Legacy test/e2e coverage is outside the scenario advisor scope.

Optional scenario E2E

  • None.

Relevant changed files

  • None.

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 27301749263
Target ref: 1ee96a9dd7989ae9e2b92d8f79cc7e92506b5a74
Workflow ref: main
Requested jobs: hermes-root-entrypoint-smoke-e2e
Summary: 1 passed, 0 failed, 0 skipped

Job Result
hermes-root-entrypoint-smoke-e2e ✅ success

@cv
cv merged commit 35b4129 into main Jun 10, 2026
44 checks passed
@cv
cv deleted the fix-4981-hermes-real-detection branch June 10, 2026 19:54
miyoungc added a commit that referenced this pull request Jun 11, 2026
## Summary
- Add the v0.0.63 release-note section using the published development
note as source context.
- Update source docs for sandbox recovery, OpenClaw config restore
safety, managed vLLM selection, Slack Socket Mode conflict handling, and
host diagnostics.
- Refresh generated `nemoclaw-user-*` skills from the updated Fern MDX
docs.
- Update the release-doc refresh skill so post-release docs for version
`n` look up the matching announcement discussion and use the `n+1` patch
release label.
- Fix CLI/docs parity by avoiding a `--from <Dockerfile>` flag mention
inside the `upgrade-sandboxes` command section.

## Source summary
- #5034 -> `docs/reference/troubleshooting.mdx`,
`docs/about/release-notes.mdx`: Document safer stale-sandbox recovery
through `rebuild --yes` before recreating from scratch.
- #5091 -> `docs/reference/troubleshooting.mdx`,
`docs/about/release-notes.mdx`: Document Docker-driver post-reboot
recovery from OpenShell container labels.
- #5101, #5174, #5177 -> `docs/manage-sandboxes/backup-restore.mdx`,
`docs/about/release-notes.mdx`: Document OpenClaw `openclaw.json`
preservation, merge behavior, and fail-safe restore handling.
- #5102 -> `docs/reference/commands.mdx`,
`docs/reference/commands-nemohermes.mdx`,
`docs/manage-sandboxes/lifecycle.mdx`, `docs/about/release-notes.mdx`:
Document `upgrade-sandboxes` image-fingerprint drift detection.
- #4201 -> `docs/reference/troubleshooting.mdx`,
`docs/about/release-notes.mdx`: Document the installer diagnostic for
unexpected Docker daemon access outside the `docker` group.
- #5038 -> `docs/inference/inference-options.mdx`,
`docs/inference/use-local-inference.mdx`,
`docs/about/release-notes.mdx`: Document the interactive managed-vLLM
model picker and non-interactive override behavior.
- #5040, #5041 -> `docs/reference/troubleshooting.mdx`,
`docs/about/release-notes.mdx`: Document Ollama auth-proxy recovery and
host DNS preflight diagnostics.
- #4986, #5039 -> `docs/manage-sandboxes/messaging-channels.mdx`,
`docs/about/release-notes.mdx`: Document Slack validation and duplicate
Slack Socket Mode sandbox handling.
- #4981, #5168 -> `docs/about/release-notes.mdx`: Capture Hermes gateway
secret-guard and wrapped-argv startup hardening in the release surface.
- Follow-up ->
`.agents/skills/nemoclaw-contributor-update-docs/SKILL.md`: Record the
post-release docs workflow, discussion-announcement lookup, and
next-patch release label rule.
- Follow-up -> `docs/reference/commands.mdx`,
`docs/reference/commands-nemohermes.mdx`: Reword custom Dockerfile
sandbox text so CLI parity does not treat `--from` as an
`upgrade-sandboxes` flag.

## Verification
- `python3 scripts/docs-to-skills.py docs/ .agents/skills/ --prefix
nemoclaw-user --doc-platform fern-mdx`
- `npm run docs`
- `npm run build:cli`
- `bash test/e2e/e2e-cloud-experimental/check-docs.sh --only-cli`
- Skip-term scan for `docs/.docs-skip` blocked terms across generated
user skills

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Enhanced local inference setup with interactive model selection
prompts and environment variable overrides
* Improved sandbox upgrade detection using build fingerprints and
version checks
* Clarified configuration restore behavior preserving user settings
during rebuild/restore
  * Added gateway authentication as fifth security layer
  * Expanded Slack messaging validation with live credential checking
* Enhanced troubleshooting guidance for Docker access, DNS issues, and
sandbox recovery
* Updated release notes for v0.0.63 featuring sandbox recovery and
inference improvements

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output bug-fix PR fixes a bug or regression integration: hermes Hermes integration behavior labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output bug-fix PR fixes a bug or regression integration: hermes Hermes integration behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants