fix(cli): probe live sandbox agent versions#4550
Conversation
Signed-off-by: Revant Patel <revant.h.patel@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a VersionCheckOptions contract, treats empty SSH probe output as failure, conditionally forces live SSH probing for running sandboxes in status and upgrade flows, preserves cached registry agentVersion during metadata updates, broadens readiness parsing, and adds tests and CLI cases validating probe-first behavior. ChangesLive sandbox version probing and drift detection
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
Signed-off-by: Revant Patel <revant.h.patel@gmail.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/lib/actions/sandbox/status.ts (1)
314-342:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy liftFix
statusagent version probing so it reports live versions when cachedagentVersionis missing.In
src/lib/actions/sandbox/status.ts,shouldProbeSandboxRuntimeVersion(...)returnslookup.state === "present" && Boolean(sandbox.agentVersion), so whensandbox.agentVersionisnullstatus setsskipProbe: trueandcheckAgentVersionreturnssandboxVersion: null. The logging only prints anAgent:line whenversionCheck.sandboxVersionexists, so running sandboxes with missing cached metadata can produce no agent version output.This is inconsistent with
src/lib/actions/upgrade-sandboxes.ts, which forces{ forceProbe: true }for all live sandboxes (liveNames.has(sandboxName)), independent of cachedagentVersion, so rebuild/upgrade can determine the actual live agent version.Align status with upgrade by probing for running sandboxes even when
sandbox.agentVersionisnull(e.g., remove theBoolean(sandbox.agentVersion)gating fromshouldProbeSandboxRuntimeVersion).🤖 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.ts` around lines 314 - 342, The status code currently sets shouldProbeRuntimeVersion = lookup.state === "present" && Boolean(sb.agentVersion), which prevents probing live sandboxes when cached sb.agentVersion is null; change the logic so shouldProbeRuntimeVersion is true for any live sandbox (i.e., remove the Boolean(sb.agentVersion) gating), and pass that into sandboxVersion.checkAgentVersion (forceProbe: shouldProbeRuntimeVersion, skipProbe: !shouldProbeRuntimeVersion) so live sandboxes are probed for their actual runtime agent version even when cached metadata is missing; update references to shouldProbeRuntimeVersion, lookup.state, sb.agentVersion, and the sandboxVersion.checkAgentVersion call accordingly.
🤖 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.
Outside diff comments:
In `@src/lib/actions/sandbox/status.ts`:
- Around line 314-342: The status code currently sets shouldProbeRuntimeVersion
= lookup.state === "present" && Boolean(sb.agentVersion), which prevents probing
live sandboxes when cached sb.agentVersion is null; change the logic so
shouldProbeRuntimeVersion is true for any live sandbox (i.e., remove the
Boolean(sb.agentVersion) gating), and pass that into
sandboxVersion.checkAgentVersion (forceProbe: shouldProbeRuntimeVersion,
skipProbe: !shouldProbeRuntimeVersion) so live sandboxes are probed for their
actual runtime agent version even when cached metadata is missing; update
references to shouldProbeRuntimeVersion, lookup.state, sb.agentVersion, and the
sandboxVersion.checkAgentVersion call accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 05f54ea1-b125-4b1c-90d7-06bdf5cdfa82
📒 Files selected for processing (2)
src/lib/actions/sandbox/status.tstest/cli.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- test/cli.test.ts
Signed-off-by: Test User <test@example.com>
|
@cv I pushed a fix for the failing |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/runtime-recovery.test.ts`:
- Around line 62-77: The test for parseReadySandboxNames needs to assert that
sandboxes with PHASE "NotReady" are excluded: update the test case inside the it
block that calls parseReadySandboxNames to include an extra line with a sandbox
whose PHASE is "NotReady" (e.g., "zeta ... NotReady") and ensure the expected
result array passed to toEqual does not contain that name; reference
parseReadySandboxNames and the current test that checks for
["alpha","epsilon","delta"] when adding the NotReady row and asserting it is
absent.
In `@src/lib/runtime-recovery.ts`:
- Around line 54-55: The current check uses cols.includes(...) which can match
tokens outside the PHASE column; instead extract the single PHASE token from
cols (e.g., let phase = cols[PHASE_INDEX] or parse the token known to represent
phase) and then evaluate it exactly: const isReadyOrRunning = phase === "Ready"
|| phase === "Running"; if (!isReadyOrRunning || phase === "NotReady") continue;
Update the logic that computes isReadyOrRunning and the subsequent check to use
the single phase variable (phase) rather than cols.includes.
🪄 Autofix (Beta)
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: 05d1011a-4a2a-476e-8e38-8f0ec1aac6d9
📒 Files selected for processing (3)
src/lib/runtime-recovery.test.tssrc/lib/runtime-recovery.tstest/cli.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- test/cli.test.ts
Signed-off-by: Test User <test@example.com>
Signed-off-by: Test User <test@example.com>
|
✨ Thanks for submitting this detailed PR about probing live sandbox agent versions, which fixes the issue of reused sandboxes being marked as up to date due to cached host metadata. This proposes a way to verify the OpenClaw version running inside live sandboxes before reporting status or deciding whether an upgrade is needed. Related open issues: |
## Summary - Adds the v0.0.56 release notes section with links to the deeper docs pages for installer, status, inference, messaging, policy, and lifecycle changes. - Updates source docs for the remaining release-prep gaps around `uv` in the PyPI preset, compact WhatsApp pairing guidance, and `nemoclaw inference set` command boundaries. - Refreshes generated `nemoclaw-user-*` skills and removes skipped experimental command terms from generated skill surfaces. ## Source summary - #4613 -> `docs/manage-sandboxes/lifecycle.mdx`, `docs/reference/commands.mdx`, `docs/about/release-notes.mdx`: Documents that public installs and `nemoclaw update` follow the maintained `lkg` tag by default. - #4419 -> `docs/about/release-notes.mdx`: Notes that non-interactive Linux installs can reactivate Docker group membership and continue in one installer run when `sg docker` is available. - #4550 -> `docs/reference/commands.mdx`, `docs/about/release-notes.mdx`: Captures live sandbox agent-version probing for status, connect, and upgrade checks. - #4609 -> `docs/inference/use-local-inference.mdx`, `docs/about/release-notes.mdx`: Captures the GPU Docker-driver host-network local-inference reachability gate. - #4607 -> `docs/manage-sandboxes/messaging-channels.mdx`, `docs/reference/commands.mdx`, `docs/about/release-notes.mdx`: Documents compact WhatsApp QR pairing guidance and gateway/session diagnostics. - #4582 -> `docs/manage-sandboxes/messaging-channels.mdx`, `docs/reference/commands.mdx`, `docs/about/release-notes.mdx`: Reflects Slack credential validation before enabling the channel. - #4554 -> `docs/manage-sandboxes/messaging-channels.mdx`, `docs/reference/troubleshooting.mdx`, `docs/about/release-notes.mdx`: Keeps Telegram allowlist alias guidance in the generated user skills and release notes. - #4563 -> `docs/reference/commands.mdx`, `docs/about/release-notes.mdx`: Includes the new `nemoclaw <name> skill remove <skill>` command in command docs and release notes. - #4566 -> `docs/reference/commands.mdx`, `docs/about/release-notes.mdx`: Documents the `nemoclaw inference set` redirect boundary when `--provider` or `--model` is missing. - #4323 -> `docs/reference/commands.mdx`, `docs/about/release-notes.mdx`: Captures per-sandbox status JSON support. - #4506 -> `docs/reference/commands.mdx`, `docs/about/release-notes.mdx`: Captures debug command sandbox-name validation and safer tarball writing. - #4569 -> `docs/network-policy/integration-policy-examples.mdx`, `docs/about/release-notes.mdx`: Documents that the `pypi` preset allows `/usr/local/bin/uv`. - #4579 -> `docs/network-policy/integration-policy-examples.mdx`, `docs/about/release-notes.mdx`: Captures observable Jira preset validation guidance. - #4229 -> `docs/manage-sandboxes/lifecycle.mdx`, `docs/reference/commands.mdx`, `docs/about/release-notes.mdx`: Documents user-data preservation defaults for uninstall. - #4399 -> `docs/reference/commands.mdx`, `docs/about/release-notes.mdx`: Captures CPU-only sandbox intent preservation across rebuilds. - #4058 -> `docs/reference/commands.mdx`, `docs/about/release-notes.mdx`: Captures safer snapshot restore behavior around existing destinations. - #4155 and #4460 -> skipped by `docs/.docs-skip`: Removed skipped experimental command terms from source docs and generated skill evals instead of documenting those features. ## Verification - `python3 scripts/docs-to-skills.py docs/ .agents/skills/ --prefix nemoclaw-user --doc-platform fern-mdx` - `npm run docs` (passes; Fern reports the pre-existing light-mode accent contrast warning) - `rg "permissive mode|shields down|shields up|shields status|config rotate-token|rotate-token" .agents/skills` (no matches) - `npm run build:cli` (run to refresh local CLI artifacts for the pre-push TypeScript hook) - Commit hooks passed, including `NEMOCLAW_* env-var documentation gate`, `Verify docs-to-skills output`, `markdownlint-cli2`, `gitleaks`, and `Test (skills YAML)`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Expanded Model Router setup with YAML examples, flow diagrams, and credential handling; strengthened agent-config immutability and integrity guidance; messaging channels updated (Telegram aliases, WhatsApp pairing/diagnostics); CLI docs revised (GPU detection, inference set behavior, uninstall/rebuild preservation); overview rebranded to NemoClaw and added v0.0.56 release notes. * **New Features** * Added `nemoclaw <name> channels status` (messaging diagnostics, JSON); added `nemoclaw <name> skill remove`; Hermes no longer marked experimental; DGX Spark quickstart sandbox-name note. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
NemoClaw now verifies the OpenClaw version actually running inside live sandboxes before reporting status or deciding whether an upgrade is needed. This prevents reused sandboxes from being marked up to date only because cached host metadata matches the current expected version.
Related Issue
Fixes #4429
Changes
statusandupgrade-sandboxes.sshwith an empty config.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Additional checks run:
npm run build:clinpm run typecheck:clinpx vitest run src/lib/onboard/sandbox-registry-metadata.test.ts src/lib/sandbox/version.test.ts src/lib/domain/maintenance/upgrade.test.ts src/lib/actions/gateway-drift-preflight.test.ts src/lib/actions/sandbox/status.test.tsgit diff --check upstream/main...HEADNote: local full hook execution was not completed because the repo's CLI coverage hook recursively invoked itself through a temporary git commit in a test fixture. The branch was pushed with local hooks skipped after the focused checks above passed.
Signed-off-by: Revant Patel revant.h.patel@gmail.com
Summary by CodeRabbit
New Features
Bug Fixes
Tests