Skip to content

fix(onboard): persist model and provider to registry after sandbox creation#1884

Merged
cv merged 3 commits intoNVIDIA:mainfrom
BenediktSchackenberg:fix/registry-model-provider-1881
Apr 14, 2026
Merged

fix(onboard): persist model and provider to registry after sandbox creation#1884
cv merged 3 commits intoNVIDIA:mainfrom
BenediktSchackenberg:fix/registry-model-provider-1881

Conversation

@BenediktSchackenberg
Copy link
Copy Markdown
Contributor

@BenediktSchackenberg BenediktSchackenberg commented Apr 14, 2026

Problem

After nemoclaw onboard, nemoclaw list shows model: unknown provider: unknown for all sandboxes. The registry has model: null and provider: null even though onboard correctly displayed the configured values.

Root cause

registry.updateSandbox(sandboxName, { model, provider }) was called at line 3643 (Step 4: inference setup) — before registry.registerSandbox() at line 2827 (Step 6: create sandbox). Since updateSandbox() silently returns false when the entry doesn't exist (registry.ts:177), the values were never persisted.

Fix

Added a registry.updateSandbox(sandboxName, { model, provider }) call immediately after createSandbox() returns. At that point the registry entry is guaranteed to exist.

Testing

  • nemoclaw onboardnemoclaw list now shows the correct model and provider
  • ~/.nemoclaw/sandboxes.json stores the configured values instead of null

Fixes #1881

Signed-off-by: Benedikt Schackenberg 6381261+BenediktSchackenberg@users.noreply.github.com

Summary by CodeRabbit

  • Bug Fixes

    • Ensures sandbox model and provider settings are persisted immediately after sandbox creation so configurations are reliably saved during onboarding.
  • Tests

    • Added a regression test to verify the onboarding flow persists settings in the correct sequence to prevent future regressions.

…eation

registry.updateSandbox() silently no-ops when the entry does not exist yet.
The call at line 3643 (inference setup, Step 4) ran before registerSandbox()
(Step 6: create sandbox), so model and provider were never persisted.

Fix: add a registry.updateSandbox(sandboxName, { model, provider }) call
immediately after createSandbox() returns, at which point the registry
entry is guaranteed to exist.

This makes `nemoclaw list` show the correct model and provider instead of
`model: unknown  provider: unknown`.

Fixes NVIDIA#1881

Signed-off-by: Benedikt Schackenberg <6381261+BenediktSchackenberg@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 14, 2026 18:46
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a6d6935a-ffa7-465f-a122-23c651daa496

📥 Commits

Reviewing files that changed from the base of the PR and between 5a5298d and 1ed078a.

📒 Files selected for processing (1)
  • test/onboard.test.ts

📝 Walkthrough

Walkthrough

A one-line fix in the onboard flow calls registry.updateSandbox(sandboxName, { model, provider }) immediately after createSandbox(...) returns, ensuring the sandbox registry entry persists model and provider values. A regression test asserting call order was added.

Changes

Cohort / File(s) Summary
Sandbox Onboarding Flow
src/lib/onboard.ts
Inserted immediate registry.updateSandbox(sandboxName, { model, provider }) call right after createSandbox(...) returns to persist model/provider after the registry entry exists.
Tests — Onboard call-order
test/onboard.test.ts
Added a regression test that reads src/lib/onboard.ts and asserts that the createSandbox(...) call appears before registry.updateSandbox(sandboxName, { model, provider }), failing if order is incorrect or snippets missing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through code with nimble paws,
Found where the sandbox lost its cause,
One tiny nudge — a call placed near,
Now model and provider appear! 🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: persisting model and provider to the registry after sandbox creation, which directly addresses the bug fix.
Linked Issues check ✅ Passed The changes directly address issue #1881 by adding the required registry.updateSandbox() call after createSandbox() to ensure model and provider are persisted, plus a regression test to prevent reoccurrence.
Out of Scope Changes check ✅ Passed All changes are scope-focused: the production fix adds four lines to persist model/provider after sandbox creation, and the test file adds regression coverage with no extraneous modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a registry persistence bug in the onboarding flow where the selected inference model and provider were not being saved for newly created sandboxes, causing nemoclaw list to display unknown.

Changes:

  • Persist model and provider to the sandbox registry immediately after createSandbox() returns (i.e., after the registry entry is guaranteed to exist).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib/onboard.ts
Comment on lines +5278 to 5282
// Persist model and provider after the sandbox entry exists in the registry.
// updateSandbox() silently no-ops when the entry is missing, so this must
// run after createSandbox() / registerSandbox() — not before. Fixes #1881.
registry.updateSandbox(sandboxName, { model, provider });
onboardSession.markStepComplete("sandbox", { sandboxName, provider, model, nimContainer });
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

Add a regression test to ensure model/provider are persisted after sandbox creation. Since this bug was caused by calling registry.updateSandbox before registry.registerSandbox existed, a unit test (similar to the existing source-order regex assertions in test/onboard.test.ts) should assert that the onboard flow calls registry.updateSandbox(sandboxName, { model, provider }) after createSandbox(...) returns, so future refactors don’t reintroduce the silent no-op behavior.

Copilot uses AI. Check for mistakes.
…sistence

Assert that registry.updateSandbox(sandboxName, { model, provider })
appears in source AFTER createSandbox() to prevent reintroduction of
the bug where updateSandbox was called before registerSandbox().

Per Copilot review on NVIDIA#1884.

Signed-off-by: Benedikt Schackenberg <6381261+BenediktSchackenberg@users.noreply.github.com>
@BenediktSchackenberg
Copy link
Copy Markdown
Contributor Author

Added a source-order regression test in test/onboard.test.ts: asserts that registry.updateSandbox(sandboxName, { model, provider }) appears after createSandbox() in the source. This prevents the bug from being silently reintroduced. 107/107 tests pass.

@cv cv enabled auto-merge (squash) April 14, 2026 19:15
@cv cv merged commit 211d19f into NVIDIA:main Apr 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(onboard): model and provider not saved to registry after sandbox creation

3 participants