fix(hermes): preserve MCP reload and Discord handshake - #8661
Conversation
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
📝 WalkthroughWalkthroughHermes rebuild recovery now restarts the gateway before MCP restoration and verifies it afterward without another replacement. Hermes Discord E2E tests now connect through an HTTP proxy gateway URL. ChangesHermes recovery sequencing
Hermes Discord proxy URL
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant RebuildPhase
participant HermesGateway
participant MCPRestoration
participant GatewayVerification
RebuildPhase->>HermesGateway: Restart before MCP restoration
HermesGateway-->>RebuildPhase: Return restart state
RebuildPhase->>MCPRestoration: Restore managed MCP configuration
MCPRestoration-->>RebuildPhase: Perform acknowledged reload
RebuildPhase->>GatewayVerification: Verify using restart state
GatewayVerification-->>RebuildPhase: Return final gateway state
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
🌿 Preview your docs: https://nvidia-preview-pr-8661.docs.buildwithfern.com/nemoclaw |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/lib/actions/sandbox/rebuild-hermes-post-restore.ts (1)
135-158: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the combined lifecycle wrappers and their tests.
The wrappers have no non-test callers. The rebuild action already uses the split APIs, which preserve MCP restoration between restart and verification.
🤖 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 `@src/lib/actions/sandbox/rebuild-hermes-post-restore.ts` around lines 135 - 158, Remove the unused ensureHermesGatewayAfterStateRestore and ensureHermesGatewayAfterStateRestoreForCronGate wrapper functions, along with their associated tests. Keep restartHermesGatewayAfterStateRestore and the separate verification APIs unchanged so the rebuild action continues preserving MCP restoration between restart and verification.Source: Path instructions
🤖 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.
Nitpick comments:
In `@src/lib/actions/sandbox/rebuild-hermes-post-restore.ts`:
- Around line 135-158: Remove the unused ensureHermesGatewayAfterStateRestore
and ensureHermesGatewayAfterStateRestoreForCronGate wrapper functions, along
with their associated tests. Keep restartHermesGatewayAfterStateRestore and the
separate verification APIs unchanged so the rebuild action continues preserving
MCP restoration between restart and verification.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: a935e575-3746-462a-ab01-5b3a57a20316
📒 Files selected for processing (8)
docs/manage-sandboxes/recover-rebuild-sandboxes.mdxsrc/lib/actions/sandbox/rebuild-hermes-post-restore.test.tssrc/lib/actions/sandbox/rebuild-hermes-post-restore.tssrc/lib/actions/sandbox/rebuild-post-restore-phase.test.tssrc/lib/actions/sandbox/rebuild-post-restore-phase.tstest/e2e/live/hermes-discord-proxy.tstest/e2e/live/hermes-discord.test.tstest/e2e/support/hermes-discord-proxy-request.test.ts
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests. 2 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. A maintainer can dispatch the default E2E suite against this exact revision. Recommended E2E: This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
Summary
Hermes rebuilds now restart the gateway before managed MCP restoration and verify the MCP-reloaded process before releasing the cron gate. The Hermes Discord E2E proof now uses an HTTP absolute-form target so aiohttp can complete its native WebSocket Upgrade through OpenShell.
Changes
ws://tohttp://; the fake server and Upgrade, credential rewrite, IDENTIFY, READY, and heartbeat assertions remain unchanged.Type of Change
Quality Gates
Documentation Writer Review
docs-updateddocs/manage-sandboxes/recover-rebuild-sandboxes.mdx;npm run docscompleted with 0 errors and 2 existing Fern warnings.DGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablenpx vitest run --project cli src/lib/actions/sandbox/rebuild-hermes-post-restore.test.ts src/lib/actions/sandbox/rebuild-post-restore-phase.test.tspassed 47 tests; the focusede2e-supportDiscord test passed 1 test.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — fullnpm testwas not run. The rebuild-focused sweep passed 684 tests with 3 skips; one parallel 5-second timeout passed 38 tests when rerun alone.npm run docsbuilds without warnings (doc changes only) — completed with 0 errors and 2 existing Fern warnings.Signed-off-by: Apurv Kumaria akumaria@nvidia.com
Summary by CodeRabbit
Bug Fixes
Documentation
Tests