fix(cli): report the sandbox agent in global list and status JSON - #8710
Conversation
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
📝 WalkthroughWalkthroughInventory and status rows now expose string-valued agents. Missing registry agents default to ChangesSandbox agent reporting
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 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-8710.docs.buildwithfern.com/nemoclaw |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit 10c1526 in the TypeScript / code-coverage/cliThe overall coverage in commit 10c1526 in the Show a code coverage summary of the most impacted files.
Updated |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/sandbox-agent-surface-parity.test.ts (1)
106-120: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd CLI-level gateway-recovery coverage.
Existing tests cover inventory construction and text rendering, but no test drives
nemoclaw list --jsonandnemoclaw listwithrecoveredFromGateway: true. Assertagent: "unknown"in JSON andagent: unknownin text.🤖 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 `@test/sandbox-agent-surface-parity.test.ts` around lines 106 - 120, Add CLI-level coverage alongside the existing parity test that exercises both `runCliJson(["list", "--json"])` and `runCli(["list"])` when gateway recovery produces `recoveredFromGateway: true`. Assert the JSON result reports `agent` as `"unknown"` and the combined text output contains `agent: unknown`, reusing the existing test setup and helpers.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 `@test/sandbox-agent-surface-parity.test.ts`:
- Around line 106-120: Add CLI-level coverage alongside the existing parity test
that exercises both `runCliJson(["list", "--json"])` and `runCli(["list"])` when
gateway recovery produces `recoveredFromGateway: true`. Assert the JSON result
reports `agent` as `"unknown"` and the combined text output contains `agent:
unknown`, reusing the existing test setup and helpers.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 9c05522d-3abb-44c9-9d34-fc6ae28b1187
📒 Files selected for processing (3)
docs/reference/commands.mdxsrc/lib/inventory/index.tstest/sandbox-agent-surface-parity.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. 1 semantic terminology decisionTerminology 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 for the commit under review. Recommended E2E: None This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
prekshivyas
left a comment
There was a problem hiding this comment.
Reviewed the latest PR commit 10c1526 against base SHA 6df126c. Focused inventory/parity tests, strict docs validation, required CI, protected E2E, independent docs review, CodeRabbit, contributor compliance, and the primary advisor lane are green. The trusted advisor publisher reports merge_as_is with zero findings.
Summary
nemoclaw list --jsonand the globalnemoclaw status --jsonreportedagentasnullfor an OpenClaw sandbox, whilenemoclaw listtext andnemoclaw <name> status --jsonreportedopenclaw. The registry storesnullfor a sandbox with no explicit agent, and only the text and sandbox-scoped surfaces resolved that marker. Both global JSON surfaces now resolve it the same way, so automation reading either surface gets the agent instead ofnull.Related Issue
Fixes #8694
Changes
resolveDisplayAgentinsrc/lib/inventory/index.tsas the one place every inventory surface resolves the stored agent marker:nullor absent becomesopenclaw, and a row recovered from the live OpenShell gateway staysunknown. A direct change at each surface is insufficient because the three current consumers (buildSandboxInventoryRow,buildStatusSandboxRow, andrenderSandboxInventoryText) drifted apart while each held its own default.test/sandbox-agent-surface-parity.test.tsprotects the shared contract.SandboxInventoryRow.agentandStatusSandboxRow.agentfromstring | nulltostring.safeStatusString(...) ?? "openclaw"fallback inbuildStatusSandboxRowwith a directredactFullcall.test/sandbox-agent-surface-parity.test.ts, which runs the CLI against a registry entry withagent: nulland asserts thatlist --json, globalstatus --json,<name> status --json, andlisttext all reportopenclaw.agentvalue contract fornemoclaw list,nemoclaw status, andnemoclaw <name> statusindocs/reference/commands.mdx.Type of Change
Quality Gates
Documentation Writer Review
docs-updateddocs/reference/commands.mdxDGX 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 unavailablenpm exec -- vitest run --project cli src/lib/inventory/index.test.ts(48/48) andnpm exec -- vitest run --project integration test/sandbox-agent-surface-parity.test.ts(1/1) passed at the latest PR commit.npm run docsbuilds without warnings (doc changes only) — strict docs validation completed with 0 errors and 2 existing repository warnings.Signed-off-by: Tinson Lai tinsonl@nvidia.com
Summary by CodeRabbit
New Features
openclaw; recovered live-gateway sandboxes displayunknown.Documentation
Tests