Skip to content

fix(sandbox): report gateway targets in status and recovery - #13134

Open
Dongni-Yang wants to merge 5 commits into
mainfrom
fix/10656-recovery-owning-gateway
Open

Dongni-Yang wants to merge 5 commits into
mainfrom
fix/10656-recovery-owning-gateway

Conversation

@Dongni-Yang

@Dongni-Yang Dongni-Yang commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Outcome

Text status names the recorded gateway before an RPC failure exits.
Recovery names its target before a readiness guard can exit.
Hermes Portable text status also names its receipt's gateway during pending, configuring, and active phases.

Reason

Gateway routing already selects the registered owner, but early failures and Portable status omit that context.
Users need the gateway name or port to diagnose the reported failure.

Related issues

Closes #10656.

Changes

  • Show the recorded gateway name or port in regular status, with not recorded for an absent registration.
  • Show the qualified receipt's gateway in Hermes Portable text status.
  • Show the recovery target through the existing gateway resolver.
  • Cover public status/recover failures and all three Portable phases with a different default gateway selected.

Verification

Revision: 2aeade5b04ffb05da298113ddaab23f786dd5a9c.

  • Portable status regression: three failed and 54 controls passed before the message change; all 57 passed afterward.
  • CLI build, CLI typecheck, and normal commit hooks pass. The status and public-command suites pass all 67 tests after the main merge.
  • Normal pre-push publication and compiler checks pass. All published commits are GitHub Verified.

Public-command tests use private gateway registries and a fake OpenShell executable.
Portable tests exercise the real receipt/registry qualifier with injected receipt observations.
They verify the gateway text, retained health semantics, and absence of added health probes or registry removal.
The contribution contains no secrets, API keys, or credentials.

Detection gap

Earlier tests checked routing and refusal separately.
They did not require gateway context on early exits or the Portable status path.
The regressions now cover both paths.

Review notes

The change adds display text within existing authority boundaries.
Failure diagnostics keep their existing nonzero exits.
Portable text status still reports saved lifecycle metadata and states that runtime and agent health were not probed.
Its JSON report retains gatewayState: "not-probed"; pending and configuring JSON commands retain exit 1.
No live gateway validation is claimed.

Independent source and test reviews found no remaining blocker.
The branch includes the merged image dependency repair and retains main's qualification receipts.
At 2aeade5, source CI, image qualification, and self-hosted qualification passed. The check collection contained 68 successful and 37 skipped checks. CodeRabbit reviewed this exact commit and reported no actionable comments.

All nine Advisor specialist reports were collected and their artifact provenance was verified. Its only finding claims that raw gateway controls reach status output. Ten isolated public CLI status/recover probes refute that path: the existing registry validator rejects the malformed name before display, preserves registry bytes, and emits no raw control characters. The same validators exist on the recorded base. No duplicate guard or routing/health change was added. The Advisor gate remains failed for this documented false positive; no valid repair group remains.

Maintainer approval remains required.


Signed-off-by: Dongni Yang dongniy@nvidia.com

Summary by CodeRabbit

  • Bug Fixes
    • Sandbox status now reports its recorded gateway in both portable and legacy views. If no gateway name is available, legacy status shows the recorded port or “not recorded.”
    • Probe-only connection output identifies the selected target gateway.
    • Diagnostics distinguish a sandbox’s recorded gateway from the selected connection target and do not assign an assumed owner to unregistered sandboxes.
    • Connection and recovery failures now identify the recorded gateway when applicable.

Show the captured gateway binding before status RPC failures.
Show the resolved target before readiness guards can stop recovery.
Keep routing, refusal behavior, and exit codes unchanged.

Closes #10656

Signed-off-by: Dongni Yang <dongniy@nvidia.com>
@Dongni-Yang Dongni-Yang self-assigned this Oct 14, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 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 Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/NemoClaw/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 57e08aaa-1ae5-44cd-9a12-aa0fe6685601
📥 Commits

Reviewing files that changed from the base of the PR and between ee99ca4 and 11ef444.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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: a8c3a77b-9fd7-449a-909d-3c33fc6085cd
📥 Commits

Reviewing files that changed from the base of the PR and between 2aeade5 and 5f9e11a.

📒 Files selected for processing: 1
  • src/lib/actions/sandbox/connect.ts
🚧 Files skipped from review as they are similar to previous changes: 1
  • src/lib/actions/sandbox/connect.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

Status output now shows the recorded gateway name, its port, or “not recorded.” Probe-only connects print the target gateway name. CLI tests cover status, recovery, and connect diagnostics for recorded and unregistered sandboxes.

Changes: Owning-Gateway Diagnostics

Layer / File(s) Summary
Status and recovery diagnostics
src/lib/actions/sandbox/status.ts, src/lib/actions/sandbox/status-flow.test.ts, test/package-contract/cli/owning-gateway-diagnostics.test.ts
Status output displays the recorded gateway name, its port, or “not recorded.” Tests cover status failures, portable status output, and recovery refusal for a recorded owner.
Connect gateway reporting
src/lib/actions/sandbox/connect.ts, test/package-contract/cli/owning-gateway-diagnostics.test.ts
Probe-only connects print the target gateway name. Tests cover connect refusals for recorded owners and an unregistered sandbox.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: deepujain

Merge Risk: ⚪ Minimal · up to 5f9e1

This change adds gateway context to sandbox diagnostics and no concrete merge-blocking risk was identified. Normal maintainer approval is still required.

Pre-merge checks: Passed 4 · Failed 1

Failed 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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 describes the primary gateway-reporting changes in sandbox status and recovery. It is concise and specific, although it does not mention the related connect diagnostics.
Linked Issues check Passed Issue #10656 requires nonzero status and recovery failures to identify the sandbox's recorded owning gateway or recovery target. status.ts reports the recorded gateway name, port, or not recorded.…
Out of Scope Changes check Passed The production changes add gateway context to status and recovery diagnostics. The tests verify the linked issue behavior and preserve routing, refusal, exit, health-probe, and registry semantics. The…
Full details: Linked Issues check

Explanation

Issue #10656 requires nonzero status and recovery failures to identify the sandbox's recorded owning gateway or recovery target. status.ts reports the recorded gateway name, port, or not recorded. connect.ts now prints the recovery target before readiness and recovery processing. The contract tests cover named and port-derived owners, missing registrations, RPC failure, refusal stages, and preserved registry state. Portable status tests cover pending, configuring, and active diagnostics while retaining gatewayState: "not-probed" and existing exit behavior.

Full details: Out of Scope Changes check

Explanation

The production changes add gateway context to status and recovery diagnostics. The tests verify the linked issue behavior and preserve routing, refusal, exit, health-probe, and registry semantics. The Portable status change and its tests implement the stated diagnostic objective. No unrelated production change or dependency change is shown.

✨ 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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-code-quality

github-code-quality Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage/plugin

main 63002cd fix/10656-recovery-o... 11ef444 +/-
96% 97% +1%
View coverage of the 10 most impacted files.
File main 63002cd fix/10656-recovery-o... 11ef444 +/-
nemoclaw/src/onboard/config.ts 98% 96% -2%
nemoclaw/src/index.ts 94% 93% -1%
nemoclaw/src/bl...print/runner.ts 95% 95% 0%
nemoclaw/src/bl...ime-identity.ts 97% 97% 0%
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/ru...time-context.ts 100% 100% 0%
nemoclaw/src/sh...er-boundary.cts 100% 100% 0%
nemoclaw/src/on...native-route.ts 0% 100% +100%

TypeScript / code-coverage/cli

main 63002cd fix/10656-recovery-o... 11ef444 +/-
84% 86% +2%
View coverage of the 10 most impacted files.
File main 63002cd fix/10656-recovery-o... 11ef444 +/-
src/lib/onboard.ts 62% 50% -12%
src/lib/actions...ess-recovery.ts 65% 81% +16%
src/lib/state/l...diness-lease.ts 66% 83% +17%
src/lib/inferen...ollama/proxy.ts 41% 61% +20%
src/lib/onboard.../application.ts 55% 84% +29%
src/lib/domain/...y/dimensions.ts 0% 71% +71%
src/lib/inferen...er/lifecycle.ts 0% 72% +72%
src/lib/actions...ry/operation.ts 0% 76% +76%
src/lib/actions...try/snapshot.ts 0% 78% +78%
src/lib/inferen...ovider/index.ts 0% 88% +88%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 21, 2026 07:27 UTC

@Dongni-Yang
Dongni-Yang marked this pull request as ready for review October 14, 2026 04:43
@Dongni-Yang Dongni-Yang removed their assignment Oct 14, 2026
Report the qualified receipt gateway while retaining unprobed health semantics.

Closes #10656

Signed-off-by: Dongni Yang <dongniy@nvidia.com>
@github-actions github-actions Bot added v0.0.138 Release target and removed v0.0.137 labels Oct 21, 2026

@rsliter rsliter 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.

Approved at head ee99ca44b63bff07e302884bb9000f6ebb462651 against base 41f72b5ec8c0d07e46ae9ebfac9bf9efdff5b28b.

Evidence:

  • The change addresses accepted bug #10656 by reporting the persisted gateway before status and probe-only recovery failures. It preserves the existing lifecycle, readiness, and mutation boundaries.
  • All 74 current check contexts are terminal and passing or legitimately skipped. The exact-head runtime activation jobs passed on amd64, arm64, and rootless Podman in run 39549765319. The trusted gate checker passed CI, conflict, CodeRabbit, risky-path, DCO, and commit-verification gates.
  • The exact-head PR Review Advisor run 39551914792 recommended no additional E2E selector. Its architecture P1 is not reproducible through the public status path: getPublishedSandbox resolves the row through findSandboxAcrossGatewayRoots, which calls registryEntryGatewayPort and rejects conflicting gateway name and port values before rendering. Existing registry tests cover that fail-closed contract.
  • Security review: PASS in all nine categories: secrets and credentials, input validation, authentication and authorization, dependencies, error handling and logging, cryptography, configuration, tests, and system interactions. The added output uses validated persisted identity and does not change authority, network access, or sandbox mutation.

No blocking defect found.

@github-actions

Copy link
Copy Markdown
Contributor

PR Review Advisor finished for commit 11ef444. 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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v0.0.138 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Ubuntu 26.04][Sandbox] multi-gateway status omits owning-gateway recovery target

2 participants