fix(plugin): make /nemoclaw status reflect real onboard state#4053
Conversation
📝 WalkthroughWalkthroughThe PR refactors the ChangesStatus Command Onboarding-Driven Refactoring
Sequence Diagram(s)sequenceDiagram
participant TUI
participant handleSlashCommand
participant loadOnboardConfig
participant getPluginConfig
participant loadState
TUI->>handleSlashCommand: /nemoclaw status
handleSlashCommand->>loadOnboardConfig: load onboard config
alt onboard config exists
loadOnboardConfig-->>handleSlashCommand: onboardConfig
handleSlashCommand->>getPluginConfig: getPluginConfig(api)
getPluginConfig-->>handleSlashCommand: sandboxName
handleSlashCommand->>loadState: loadState()
loadState-->>handleSlashCommand: rebuild/rollback metadata
handleSlashCommand-->>TUI: status with sandbox/endpoint/provider/model/onboarded (+ optional metadata)
else onboard config missing
loadOnboardConfig-->>handleSlashCommand: null
handleSlashCommand-->>TUI: "no onboard configuration found"
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 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)
Comment |
slashStatus gated all output on state.lastAction, which nothing in production code ever writes to ~/.nemoclaw/state/nemoclaw.json. The result was that /nemoclaw status in the OpenClaw TUI always printed "No operations performed yet. Run nemoclaw onboard to get started." even after a successful onboard and a running sandbox. Derive the response from sources that are actually populated: the onboard config (already used by /nemoclaw onboard) and the plugin config sandbox name. Keep the rebuild and migration-snapshot lines behind their state guards so a future blueprint runner that wires up saveState() picks them up automatically. Fixes NVIDIA#4010 Signed-off-by: Dongni Yang <dongniy@nvidia.com>
267ee5f to
6eb2d4e
Compare
Manual verification — passedVerified locally on Ubuntu 20.04 / Docker 24.0.7 / OpenShell 0.0.39 against a sandbox built from this branch ( Sandbox plugin loaded the fix
|
ericksoa
left a comment
There was a problem hiding this comment.
Approved. Independent adversarial review found the status-output code path sound; the only blocker was PR linkage auto-closing #4010 while autocomplete remains unresolved. I updated the PR body to use non-closing Refs language and will squash with a non-closing body. Checks are green on head f4ce62c.
Summary
/nemoclaw statusin the OpenClaw TUI always printed "No operations performed yet. Runnemoclaw onboardto get started.", even after a successful onboard and a running sandbox. Root cause:slashStatusgated its output onstate.lastAction, but nothing in production code ever callssaveState(), so that field is permanentlynull.loadOnboardConfig()(already used by/nemoclaw onboard) and the plugin config sandbox name. Keep the rebuild and migration-snapshot lines behind their state guards so a future blueprint runner that wires upsaveState()picks them up automatically.Refs #4010
Note: this PR addresses the misleading status output portion of #4010; subcommand autocomplete remains tracked on the issue.
Signed-off-by: Dongni Yang dongniy@nvidia.com
Test plan
npx vitest run(plugin) — 457/457 pass, including the updated status testsnpm run typecheck:cliand plugintsc --noEmitnpx @biomejs/biome lintandformaton touched files/nemoclaw statusshows sandbox name, endpoint, provider, model, and onboarded timestamp instead of the misleading hintManual verification output
Verified on Ubuntu 20.04 / Docker 24.0.7 / OpenShell 0.0.39 against a sandbox built from this branch (
6eb2d4e3f), reproducing the exact steps from #4010.Sandbox plugin loaded the fix:
/nemoclaw statusinsideopenclaw tui:Pre-fix the same command always returned "NemoClaw: No operations performed yet. Run
nemoclaw onboardto get started." regardless of onboard state — confirmed gone.Fallback path (no onboard config → "No onboard configuration found" hint) is exercised by the new unit test
"reports the onboard hint when no onboard config exists"innemoclaw/src/commands/slash.test.ts.Security note
Endpointis rendered viadescribeOnboardEndpoint, which already redacts URL userinfo andtoken/key/secret/auth/sig/credential/passwordquery params. No new credential disclosure surface; the newslashStatusdoes not emit the credential env-var name (the existingslashOnboardalready did and is unchanged).