Skip to content

fix(e2e): bound MCP discovery and verify backup transport - #12494

Closed
prekshivyas wants to merge 8 commits into
mainfrom
codex/fix-mcp-discovery-rebuild-backup
Closed

prekshivyas wants to merge 8 commits into
mainfrom
codex/fix-mcp-discovery-rebuild-backup

Conversation

@prekshivyas

@prekshivyas prekshivyas commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Outcome

Give the MCP bridge E2E fixture enough time to discover tools through its public tunnel. Require OpenShell command transport to verify a running OpenClaw sandbox’s maintenance window before rebuild starts its backup.

Reason

Run 36593348569 returned no deferred MCP tools and aborted Telegram rebuild during pre-rebuild backup. Controlled testing reproduced MCP discovery exceeding the default 1.5-second budget. A privileged Docker maintenance receipt can also arrive before OpenShell command transport is ready. The original Telegram failure’s precise trigger remains unconfirmed.

Changes

  • Set the existing NEMOCLAW_MCP_TOOLS_LIST_TIMEOUT_MS override to 5000 for MCP fixture onboarding and rebuild. Production defaults and tool-call timeouts remain unchanged.
  • Verify the same backup maintenance receipt through OpenShell command transport after privileged verification. Retry within the existing six-minute maintenance deadline; stop before replacement if verification fails.
  • Report SSH configuration, SSH discovery, and unsafe-entry failures separately without returning raw stderr. Preserve deadline-expiry classification.
  • Capture bounded, redacted diagnostics after Telegram rebuild failure and MCP credential-rotation tool-call failure. Preserve the original operation’s result.
  • Document the maintenance check, discovery failure reasons, fixture timeout, and diagnostic capture.
  • Extend the existing discovery-deadline test to assert empty archive results, failed state-path accounting, and no stderr disclosure. Retain its exact diagnostic and no-SSH assertions; add no duplicate fixture or runtime change.

Verification

  • Latest local change: 11 tests passed across snapshot-backup-deadline-boundary.test.ts and snapshot-transport-errors.test.ts.
  • Published commit 986337c629c02b29a266bdb09eeacf620ba0878b passed CI and the managed-images workflow. CodeRabbit was clear on that commit. These results predate the six-line test extension.
  • Documentation validation on the published commit passed. The test-only follow-up requires no new documentation; independent source and documentation review passed.
  • No secrets, API keys, or credentials added.

Review notes

Commit under review: d8dfa08926a9c4a0313233603be8d7a5f60c336a. All eight PR commits have valid GitHub signatures. Normal commit and publication hooks passed. CI and automated reviews for this commit are pending.

Advisor run 36863091222 identified one deadline-result coverage gap. The existing deadline case now checks the requested result fields and stderr non-disclosure. A new Advisor result is pending.

Passing focused tests and prior CI do not establish passing MCP/Telegram live E2E for the new commit. Final live evidence remains outstanding. The maintainer approved staging Brev Launchable for this PR, including deployment, the full E2E suite, and workspace cleanup verification. This update stays in PR #12494 and does not merge it or create another PR.

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: docs-updated
  • Evidence: Reviewed the complete PR context and the six-line test extension. Existing recovery and E2E documentation remain accurate; no additional documentation is needed for this test-only change. All 11 focused tests pass. Review is bound to the commit above.
  • Agent: Codex Desktop

Signed-off-by: Prekshi Vyas prekshiv@nvidia.com

Summary by CodeRabbit

  • Bug Fixes
    • Sandbox rebuilds now confirm command access before replacing a sandbox after backup, waiting for access to recover within the existing deadline. If checks fail, the rebuild stops and reports the failure.
    • Backup errors now distinguish unsafe directory entries from connection failures and clarify when no archive was captured.
  • Documentation
    • Updated OpenClaw rebuild guidance with maintenance-window checks and troubleshooting steps for SSH failures, unsafe entries, and expired backup deadlines.

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@prekshivyas prekshivyas self-assigned this Sep 29, 2026
@copy-pr-bot

copy-pr-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
🧰 Additional context used
📚 Code guidelines (1)
test/README.md — configured

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/NemoClaw/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a9790267-5d1a-4b72-a2ca-d23bab5dadb7

📥 Commits

Reviewing files that changed from the base of the PR and between 986337c and d8dfa08.

📒 Files selected for processing (1)
  • test/state/snapshot-backup-deadline-boundary.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

Privileged backup readiness now checks OpenShell command transport. State archive errors identify when no archive was captured. E2E tests set an MCP discovery timeout and capture diagnostics for selected failures.

Changes

Sandbox backup recovery

Layer / File(s) Summary
Backup transport readiness
src/lib/actions/sandbox/process-recovery.ts, src/lib/actions/sandbox/process-recovery-openclaw-doctor.test.ts, docs/manage-sandboxes/recover-rebuild-sandboxes.mdx
Backup quiescence checks the maintenance window through OpenShell command transport. Tests cover recovery and timeout cases. Documentation describes the bounded wait and failure behavior.
State archive failure reporting
src/lib/state/sandbox.ts, test/state/snapshot-transport-errors.test.ts, test/state/snapshot-backup-deadline-boundary.test.ts, docs/manage-sandboxes/recover-rebuild-sandboxes.mdx
SSH configuration and state-directory discovery errors state that no archive was captured. Tests verify failure details, exit status, empty archive results, and stderr redaction. Documentation lists discovery failure causes and recovery steps.

E2E MCP and rebuild reliability

Layer / File(s) Summary
MCP discovery and tool-call checks
test/e2e/live/mcp-bridge-onboard-env.ts, test/e2e/support/mcp-bridge-onboard-env.test.ts, test/e2e/live/mcp-bridge.test.ts
The exact-main environment sets a 5,000 ms tool-discovery timeout. MCP tests apply Hermes-specific capture and response checks while retaining result checks for other agents.
Failure diagnostic capture
test/e2e/live/mcp-bridge.test.ts, test/e2e/live/channels-add-remove.test.ts, test/e2e/support/channels-add-remove-helpers.test.ts, test/e2e/docs/README.md
Credential-rotation and Telegram rebuild checks capture failure diagnostics. Tests verify capture arguments, redaction values, and behavior after failed or successful rebuilds. Documentation describes capture timing and scope.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant BackupQuiesce
  participant PrivilegedProbe
  participant OpenShellTransport
  BackupQuiesce->>PrivilegedProbe: Verify maintenance window
  BackupQuiesce->>OpenShellTransport: Repeat probe within deadline
  OpenShellTransport-->>BackupQuiesce: Return transport readiness
Loading

Suggested reviewers: ericksoa, cv

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 11 files. 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 clearly summarizes the two primary changes: bounding MCP discovery time and verifying backup transport.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

@github-actions

Copy link
Copy Markdown
Contributor

@github-code-quality

github-code-quality Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit d8dfa08 in the codex/fix-mcp-discov... branch is 97%. The line coverage in commit 63002cd in the main branch is 96%.

Show a line coverage summary of the most impacted files.
File main 63002cd codex/fix-mcp-discov... d8dfa08 +/-
nemoclaw/src/onboard/config.ts 98% 96% -2%
nemoclaw/src/index.ts 94% 93% -1%
nemoclaw/src/bl...t-management.ts 100% 100% 0%
nemoclaw/src/co.../config-show.ts 100% 100% 0%
nemoclaw/src/commands/slash.ts 100% 100% 0%
nemoclaw/src/on...native-route.ts 0% 100% +100%

TypeScript / code-coverage/cli

The overall line coverage in commit d8dfa08 in the codex/fix-mcp-discov... branch is 85%. The line coverage in commit 63002cd in the main branch is 84%.

Show a line coverage summary of the most impacted files.
File main 63002cd codex/fix-mcp-discov... d8dfa08 +/-
src/lib/actions.../status-text.ts 84% 46% -38%
src/lib/onboard...al-inference.ts 84% 90% +6%
src/lib/inferen...file/cleanup.ts 73% 80% +7%
src/lib/state/p...l-retirement.ts 79% 89% +10%
src/lib/readine...y-production.ts 76% 90% +14%
src/lib/onboard.../application.ts 55% 72% +17%
src/lib/onboard...mage/catalog.ts 69% 90% +21%
src/lib/securit...zer-boundary.ts 0% 85% +85%
src/lib/onboard...ternal-image.ts 0% 94% +94%
src/lib/securit...ig-structure.ts 0% 94% +94%

Updated October 01, 2026 14:04 UTC

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@prekshivyas

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@prekshivyas

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@prekshivyas

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@prekshivyas

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@prekshivyas
prekshivyas marked this pull request as ready for review September 29, 2026 22:37

@deepujain deepujain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 85bec4311c22c2b9d94a04272ca16a51f160f231. No new code defect found in the changed backup admission, discovery errors, MCP fixture timeout, or failure diagnostics. The transport probe stays within the existing maintenance deadline, failures stop backup, and diagnostic collection preserves the original failed operation.

Local validation: 155 tests passed across six files, covering maintenance recovery and timeout, backup transport errors, channel diagnostics, MCP environment construction, MCP failure evidence, and Hermes HTTP diagnostics. I also read all nine specialist findings and E2E recommendations from Advisor run 36639347097; all are clear for this commit.

Approval is held by the failing required checks aggregate in CI run 36638870509. Its audit artifacts reject three advisories for undici@8.10.0. The manifests and lockfiles match base b1494a0, so this is inherited dependency debt. Please resolve it through the dependency fix or repository-approved audit policy, then provide passing required checks.

Live validation is still unproven: run 36631187132 tested an earlier commit. The OpenClaw MCP and Telegram jobs failed while restoring the CLI because snapshot-sanitizer-boundary.cjs was missing, before the affected scenarios executed. The focused tests above do not establish that the original live failures are fixed. Advisor requests no additional selectors beyond the existing plan; it does not certify a passing live run.

This is a COMMENT review, not an approval. No additional candidate code change is requested by this review.

@prekshivyas

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor finished for commit d8dfa08. Include the Advisor findings in the complete PR feedback collection. Verify and group valid findings before repair.

Request review only when Require no Advisor blockers is green.

All previous runs

@prekshivyas prekshivyas closed this Oct 2, 2026
@wscurran wscurran added area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery area: security Security controls, permissions, secrets, or hardening bug-fix PR fixes a bug or regression integration: openclaw OpenClaw integration behavior integration: telegram Telegram integration or channel behavior platform: container Affects Docker, containerd, Podman, or images labels Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery area: security Security controls, permissions, secrets, or hardening bug-fix PR fixes a bug or regression integration: openclaw OpenClaw integration behavior integration: telegram Telegram integration or channel behavior platform: container Affects Docker, containerd, Podman, or images

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants