Skip to content

fix(status): point SSH operators to dashboard-url for remote access - #8528

Merged
apurvvkumaria merged 5 commits into
mainfrom
fix/8465-status-ssh-remote-access-hint-v3
Aug 7, 2026
Merged

fix(status): point SSH operators to dashboard-url for remote access#8528
apurvvkumaria merged 5 commits into
mainfrom
fix/8465-status-ssh-remote-access-hint-v3

Conversation

@jason-ma-nv

@jason-ma-nv jason-ma-nv commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

nemoclaw <sandbox> status previously gave no remote-access guidance for a loopback-only dashboard when an operator ran it over SSH. For OpenClaw and Hermes, status now points to nemoclaw <sandbox> dashboard-url only when the gateway is running and the shared dashboard-access decision determines that a port forward is needed. The displayed command shell-quotes the sandbox name so valid names with spaces or metacharacters remain one argument.

Related Issue

Closes #8465

Changes

  • src/lib/actions/sandbox/status-text.ts: route the status hint through buildSshForwardHintLines, using the persisted dashboard port and the routable-dashboard state. Omit the hint outside SSH, for a stopped gateway, for a routable dashboard, or when the dashboard port is unavailable. Render the sandbox name with the existing shell-quoting helper.
  • docs/deployment/deploy-to-headless-server.mdx: document the precise SSH, running-gateway, and loopback conditions for OpenClaw and Hermes. Deep Agents correctly omits browser-dashboard guidance.
  • test/support/status-flow-test-harness.ts: expose the gateway-running control and remote-bind registry state needed to exercise the public status path.
  • src/lib/actions/sandbox/status-flow.test.ts: cover SSH guidance, a shell-quoted sandbox name, a routable dashboard URL, a prepared remote bind, a stopped gateway, and a non-SSH session.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Nine-category maintainer security review passed with no findings.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: No waiver is recorded.

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: docs-updated
  • Evidence: The deployment guide now scopes the hint to OpenClaw and Hermes, states the SSH/running/loopback conditions, and explains the quoted sandbox argument. OpenClaw and Hermes variants contain the correct agent command; Deep Agents omits the guidance. npm run docs passes with 0 errors and 2 unrelated Fern warnings.
  • Agent: Codex Desktop (independent documentation writer)

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub — all four commits are verified.
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable — normal hooks and the full changed-file hook suite passed.
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — npx vitest run --project cli src/lib/actions/sandbox/status-flow.test.ts passes 39 tests; npm run typecheck:cli passes.
  • Applicable broad gate passed — fresh required GitHub Actions are running; no waiver is recorded.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only) — passes with 0 errors and 2 existing Fern warnings unrelated to this page.
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only) — not applicable; no new page was added.

Signed-off-by: Jason Ma jama@nvidia.com

Summary by CodeRabbit

  • New Features

    • Added SSH-aware guidance to sandbox status output when the gateway is running.
    • Users can access the dashboard remotely with port-forwarding instructions through the dashboard-url command.
    • Dashboard guidance is shown only when remote forwarding is required and uses safe shell quoting for sandbox names.
  • Documentation

    • Updated deployment guidance for remote dashboard access over SSH.
  • Tests

    • Added coverage for SSH, non-SSH, gateway, and dashboard access scenarios.

`nemoclaw <sandbox> status` gave no remote-access guidance when run over
SSH, unlike `dashboard-url` and the post-onboard block that print an
`ssh -L` port-forward example (#5925). A remote operator checking status
was left without a pointer to reach the loopback-only dashboard.

Extend the #5925 guidance to the status surface: when the gateway is
running and the CLI is in an SSH session, print a pointer to
`nemoclaw <sandbox> dashboard-url`, which renders the copy-pastable
port-forward block. Scoped to the running gateway-runtime path, so
terminal-runtime sandboxes (no dashboard) are unaffected.

Closes #8465

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Jason Ma <jama@nvidia.com>
@jason-ma-nv jason-ma-nv added the area: docs Documentation, examples, guides, or docs build label Aug 7, 2026
@jason-ma-nv jason-ma-nv self-assigned this Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Sandbox status now directs SSH users to dashboard-url when the gateway is running and dashboard forwarding is required. Tests cover gateway, bind, URL, shell-quoting, and SSH-session conditions. Deployment documentation describes the guidance.

Changes

SSH status guidance

Layer / File(s) Summary
SSH-aware status rendering and harness support
src/lib/actions/sandbox/status-text.ts, test/support/status-flow-test-harness.ts
Status output checks SSH access, gateway state, dashboard URL state, and remote bind state. It prints a quoted dashboard-url command when forwarding is required. The harness exposes configurable gateway and bind state.
Behavior tests and deployment guidance
src/lib/actions/sandbox/status-flow.test.ts, docs/deployment/deploy-to-headless-server.mdx
Tests cover SSH and non-SSH sessions, stopped gateways, available URLs, prepared remote binds, and shell-safe sandbox names. Documentation describes the SSH guidance.

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

Sequence Diagram(s)

sequenceDiagram
  participant SSHSession
  participant SandboxStatus
  participant DashboardAccess
  SSHSession->>SandboxStatus: run status
  SandboxStatus->>DashboardAccess: check gateway and dashboard access state
  DashboardAccess-->>SandboxStatus: return forwarding guidance when required
  SandboxStatus-->>SSHSession: print dashboard-url command
Loading

Possibly related PRs

  • NVIDIA/NemoClaw#8514: Directly extends the same SSH dashboard guidance and related status tests.
  • NVIDIA/NemoClaw#8516: Directly updates the same status rendering, test harness, and dashboard access tests.

Suggested labels: bug-fix

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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
Linked Issues check ✅ Passed The changes satisfy #8465 by guiding SSH users to dashboard-url when the gateway requires remote dashboard access.
Out of Scope Changes check ✅ Passed The implementation, tests, harness updates, and documentation all directly support the linked SSH dashboard guidance objective.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: directing SSH operators to dashboard-url for remote dashboard access.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/8465-status-ssh-remote-access-hint-v3

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

@github-code-quality

github-code-quality Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit eae84db in the fix/8465-status-ssh-... branch remains at 96%, unchanged from commit d8fbb6e in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit eae84db in the fix/8465-status-ssh-... branch remains at 81%, unchanged from commit d8fbb6e in the main branch.

Show a code coverage summary of the most impacted files.
File main d8fbb6e fix/8465-status-ssh-... eae84db +/-
src/lib/agent/d...e-base-image.ts 100% 86% -14%
src/lib/onboard...-transaction.ts 93% 93% 0%
src/lib/inferen...ompatibility.ts 90% 90% 0%
src/lib/actions.../status-text.ts 41% 41% 0%
src/lib/messagi...nnels/policy.ts 100% 100% 0%
src/lib/onboard...forward-hint.ts 100% 100% 0%
src/lib/sandbox...rce-identity.ts 83% 83% 0%
src/lib/platform.ts 84% 89% +5%

Updated August 07, 2026 10:29 UTC

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/lib/actions/sandbox/status-flow.test.ts (1)

678-703: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover the SSH and stopped-gateway boundary.

The tests cover SSH with a running gateway and non-SSH with a running gateway. They do not prove that an SSH session omits the hint when the gateway is stopped. Add a public-boundary case with gatewayRunning: false and assert that Remote access: run is absent.

Suggested test
+  it("omits dashboard guidance over SSH when the gateway is stopped (`#8465`)", async () => {
+    vi.stubEnv("SSH_CONNECTION", "203.0.113.9 51000 198.51.100.2 22");
+    const harness = createStatusFlowHarness({ gatewayRunning: false });
+
+    await expect(harness.showSandboxStatus("alpha")).resolves.toBeUndefined();
+
+    const output = harness.logSpy.mock.calls.map((call) => String(call[0])).join("\n");
+    expect(output).toContain("not running");
+    expect(output).not.toContain("Remote access: run");
+  });

As per path instructions, tests must verify observable behavior through the public boundary.
As per coding guidelines, run tests targeted to changed behavior once per relevant change set.

🤖 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/status-flow.test.ts` around lines 678 - 703, Add a
test alongside the existing SSH cases that stubs an SSH session, creates the
status-flow harness with gatewayRunning: false, and invokes
showSandboxStatus("alpha") through the public boundary. Assert the call resolves
successfully and the captured output omits “Remote access: run”, preserving the
stopped-gateway behavior.

Sources: Coding guidelines, 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.

Inline comments:
In `@src/lib/actions/sandbox/status-text.ts`:
- Around line 386-391: Update printDashboardRemoteAccessHint to shell-quote
sandboxName when constructing the copy-pastable dashboard-url command. Reuse the
existing shell-quoting helper already used by the status flow, preserving the
current hint text and command structure.

---

Nitpick comments:
In `@src/lib/actions/sandbox/status-flow.test.ts`:
- Around line 678-703: Add a test alongside the existing SSH cases that stubs an
SSH session, creates the status-flow harness with gatewayRunning: false, and
invokes showSandboxStatus("alpha") through the public boundary. Assert the call
resolves successfully and the captured output omits “Remote access: run”,
preserving the stopped-gateway behavior.
🪄 Autofix

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: 86028052-b630-4bf2-bb53-e33252e41b3a

📥 Commits

Reviewing files that changed from the base of the PR and between e3a824d and e0ae714.

📒 Files selected for processing (4)
  • docs/deployment/deploy-to-headless-server.mdx
  • src/lib/actions/sandbox/status-flow.test.ts
  • src/lib/actions/sandbox/status-text.ts
  • test/support/status-flow-test-harness.ts

Comment thread src/lib/actions/sandbox/status-text.ts Outdated
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / low confidence
Next action: Review the warnings below.
Findings: 0 blockers · 1 warning · 0 suggestions
Status: Partial review preserved 1 canonical finding(s) and 3 terminology decision(s) before the advisor stopped.

Model lanes

  • GPT-5.6 Terra (primary): Failed after a partial review · low confidence · 0 blockers · 1 warning · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Failed

Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests.

3 semantic terminology decisions

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • established — Remote access at src/lib/actions/sandbox/status-text.ts:394: Keep the established term.
  • established — SSH port forward at src/lib/actions/sandbox/status-text.ts:394: Keep the established term.
  • justified — loopback dashboard access at docs/deployment/deploy-to-headless-server.mdx:242: Keep the modifier because it distinguishes loopback-only dashboard access from a routable dashboard.

E2E guidance

Advisory only. A maintainer can dispatch the default E2E suite against this exact revision.

Recommended E2E: onboard-repair, onboard-resume

1 warning · 0 suggestions

Warnings

Warnings do not block.

PRA-1 Warning — Use the dashboard access resolver for the status hint

  • Location: src/lib/actions/sandbox/status-text.ts:387
  • Category: correctness
  • Problem: The status hint reconstructs dashboard access from the persisted remote-bind flag and `CHAT_UI_URL`, rather than using the dashboard-access resolver used by `dashboard-url`.
  • Impact: An SSH operator can receive a status pointer that disagrees with the forwarding guidance produced by `dashboard-url` after a dashboard bind or platform configuration changes.
  • Recommendation: Obtain the effective access URL through the existing dashboard-access resolver before deciding whether to print the status pointer.
  • Verification: Compare the access URL used by `status` and `dashboard-url` with WSL or `NEMOCLAW_DASHBOARD_BIND=0.0.0.0` configured.
  • Test coverage: Add a status-flow test where the persisted remote-bind flag differs from the effective dashboard-access chain, and assert that status and `dashboard-url` agree on whether SSH-forward guidance applies.
  • Evidence: src/lib/actions/sandbox/status-text.ts:387-392 src/commands/sandbox/dashboard-url.ts:39-42 src/lib/onboard/dashboard-access.ts:70-79 src/lib/dashboard/contract.ts:103-126

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

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

Two correctness changes are required. Shell-quote sandboxName in the displayed command so valid names with spaces or metacharacters remain copy-pastable. Also do not promise SSH port-forward instructions solely from SSH-session state: dashboard-url omits those instructions for a routable non-loopback dashboard. Reuse the dashboard access applicability decision or make the text accurate for both bindings, and add tests for a quoted sandbox name and a remotely bound dashboard. Then fix the failing Fern preview and refresh the branch onto current main.

@apurvvkumaria apurvvkumaria self-assigned this Aug 7, 2026
@apurvvkumaria apurvvkumaria added the v0.0.105 Release target label Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Sensitive-path security review

Result: PASS for branch revision 1201c48c4 against current main revision b5ac55701.

  1. Secrets and credentials: PASS. No credential sources, environment allowlists, secret handling, or sensitive logging changed.
  2. Input validation and data sanitization: PASS. The sandbox name is rendered with the existing shell-quoting helper, preventing spaces and shell metacharacters from changing the displayed command.
  3. Authentication and authorization: PASS. No identity, permission, ownership, reviewer-routing, or authority behavior changed.
  4. Dependencies and third-party libraries: PASS. No package, image, action, registry, or dependency metadata changed.
  5. Error handling and logging: PASS. Guidance is omitted when the dashboard port is unavailable, the session is not SSH, the gateway is stopped, or the dashboard is already routable.
  6. Cryptography and data protection: PASS. No cryptographic or protected-data behavior changed.
  7. Configuration and security headers: PASS. No schema, network policy, listener, port default, capability, privilege, or header changed.
  8. Security testing: PASS. Public-boundary regressions cover a quoted sandbox name, a routable dashboard URL, a prepared remote bind, a stopped gateway, and a non-SSH session. The focused suite passes 39 tests; CLI type checking, repository hooks, and the documentation build pass.
  9. System security: PASS. The change is display-only and reuses the shared SSH forwarding applicability decision; it does not alter sandbox lifecycle, process execution, exposure, or host state.

Required CI and independent maintainer approval remain separate merge requirements.

@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Addressed the requested changes in the refreshed branch revision:

  • The displayed sandbox name now uses the existing shell-quoting helper.
  • Status uses the shared SSH forwarding applicability check and omits the hint for routable dashboard access.
  • Regression coverage includes a quoted name, a routable URL, a prepared remote bind, a stopped gateway over SSH, and a non-SSH session.
  • The branch now includes current main through b5ac55701, with no overlap in the changed files.
  • The earlier Fern failure was a registry/network timeout after local validation reported 0 errors. Fern passed on the maintainer refresh, and the new branch update has started another preview.

Local validation passes: 39 focused tests, CLI type checking, the complete changed-file hook suite, repository architecture checks, and docs with 0 errors. The documentation receipt and security review are current. Fresh required CI and independent re-review remain pending.

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

The refreshed diff addresses both requested correctness changes: sandbox names are shell-quoted, and the status hint uses the shared loopback-forward applicability decision. Tests cover quoted names, routable URLs, prepared remote binds, stopped gateways, and non-SSH sessions. All five required checks pass on this head, with no unresolved correctness or security finding.

@apurvvkumaria
apurvvkumaria merged commit 19b096b into main Aug 7, 2026
45 of 47 checks passed
@apurvvkumaria
apurvvkumaria deleted the fix/8465-status-ssh-remote-access-hint-v3 branch August 7, 2026 10:36
apurvvkumaria added a commit that referenced this pull request Aug 7, 2026
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Documentation, examples, guides, or docs build release-target v0.0.105 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Ubuntu 24.04][CLI&UX] nemoclaw status omits SSH remote-access guidance

3 participants