Skip to content

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

Merged
cv merged 1 commit intoNVIDIA:mainfrom
TruongNguyenG:fix/registry-model-provider
Apr 14, 2026
Merged

fix(onboard): persist model and provider to sandbox registry after creation#1883
cv merged 1 commit intoNVIDIA:mainfrom
TruongNguyenG:fix/registry-model-provider

Conversation

@TruongNguyenG
Copy link
Copy Markdown
Contributor

@TruongNguyenG TruongNguyenG commented Apr 14, 2026

Summary

Fix nemoclaw list showing model: unknown provider: unknown after onboard.
registry.updateSandbox() at Step 4 (inference setup) runs before the sandbox
entry exists in the registry. updateSandbox silently returns false when the
entry is not found, so the model and provider are never saved.
registerSandbox() at Step 6 (create sandbox) later creates the entry without
model or provider.
Add registry.updateSandbox(sandboxName, { model, provider }) after
createSandbox() returns, so the update runs after the entry exists.

Related Issue

issue 1881

Changes

Type of Change

  • Code change for a new feature, bug fix, or refactor.
  • Code change with doc updates.
  • Doc only. Prose changes without code sample modifications.
  • Doc only. Includes code sample changes.

Testing

  • npx prek run --all-files passes (or equivalently make check).
  • npm test passes.
  • make docs builds without warnings. (for doc-only changes)

Checklist

General

Code Changes

  • Formatters applied — npx prek run --all-files auto-fixes formatting (or make format for targeted runs).
  • Tests added or updated for new or changed behavior.
  • No secrets, API keys, or credentials committed.
  • Doc pages updated for any user-facing behavior changes (new commands, changed defaults, new features, bug fixes that contradict existing docs).

Doc Changes

  • Follows the style guide. Try running the nemoclaw-contributor-update-docs agent skill to draft changes while complying with the style guide. For example, prompt your agent with "/nemoclaw-contributor-update-docs catch up the docs for the new changes I made in this PR."
  • New pages include SPDX license header and frontmatter, if creating a new page.
  • Cross-references and links verified.

Signed-off-by: Truong Nguyen tgnguyen@nvidia.com

Summary by CodeRabbit

  • Bug Fixes
    • Ensured sandbox model and provider metadata are reliably saved when a sandbox is created or reused, including cases where later setup steps are skipped or resumed—preventing loss of configuration.

@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: 83428eec-24d7-4e5c-b570-25ae7874d273

📥 Commits

Reviewing files that changed from the base of the PR and between 28f1954 and c832a4c.

📒 Files selected for processing (1)
  • src/lib/onboard.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/onboard.ts

📝 Walkthrough

Walkthrough

A single call to registry.updateSandbox(sandboxName, { model, provider }) was added to onboard() immediately after createSandbox(...) so model and provider metadata are persisted when a sandbox is created or reused, independent of later inference setup.

Changes

Cohort / File(s) Summary
Sandbox Metadata Persistence
src/lib/onboard.ts
Added registry.updateSandbox(sandboxName, { model, provider }) right after sandbox creation/reuse to ensure model and provider are stored even if inference setup is skipped or bypassed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 I hopped to the sandbox, neat and bright,
Gave model and provider a home tonight,
No longer lost in later haze,
Their names are saved in tidy ways,
A small hop, a steady light ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(onboard): persist model and provider to sandbox registry after creation' directly and clearly summarizes the main change: persisting model and provider metadata to the sandbox registry after creation, which fixes the onboarding bug described in the PR objectives.
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.

@TruongNguyenG TruongNguyenG changed the title Fix/registry model provider fix(onboard): persist model and provider to sandbox registry after creation Apr 14, 2026
@TruongNguyenG TruongNguyenG force-pushed the fix/registry-model-provider branch from 00eebfe to 28f1954 Compare April 14, 2026 18:30
@TruongNguyenG TruongNguyenG marked this pull request as ready for review April 14, 2026 18:31
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/lib/onboard.ts`:
- Line 5254: The call to registry.updateSandbox(sandboxName, { model, provider
}) can fail silently (return false) and leave the sandbox unpersisted; change
the code to check the boolean result of registry.updateSandbox and if it returns
false, call a fallback to create the entry (e.g., registry.createSandbox or
equivalent) with sandboxName and the same { model, provider } payload, and log
or surface any error from the fallback; reference registry.updateSandbox,
sandboxName, model, provider and the fallback creation method to locate and
implement the change.
🪄 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: Pro Plus

Run ID: e6dc3a85-1c1f-4192-b4d4-46e515f32d40

📥 Commits

Reviewing files that changed from the base of the PR and between 238e0a1 and 28f1954.

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

Comment thread src/lib/onboard.ts
agent,
dangerouslySkipPermissions,
);
registry.updateSandbox(sandboxName, { model, provider });
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.

⚠️ Potential issue | 🟡 Minor

Add a fallback when updateSandbox returns false.

Line 5254 reuses an API that can fail silently. If the sandbox is reused but its local registry entry is missing, model/provider still won’t persist.

Suggested patch
-      registry.updateSandbox(sandboxName, { model, provider });
+      if (!registry.updateSandbox(sandboxName, { model, provider })) {
+        registry.registerSandbox({ name: sandboxName, model, provider });
+      }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
registry.updateSandbox(sandboxName, { model, provider });
if (!registry.updateSandbox(sandboxName, { model, provider })) {
registry.registerSandbox({ name: sandboxName, model, provider });
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/onboard.ts` at line 5254, The call to
registry.updateSandbox(sandboxName, { model, provider }) can fail silently
(return false) and leave the sandbox unpersisted; change the code to check the
boolean result of registry.updateSandbox and if it returns false, call a
fallback to create the entry (e.g., registry.createSandbox or equivalent) with
sandboxName and the same { model, provider } payload, and log or surface any
error from the fallback; reference registry.updateSandbox, sandboxName, model,
provider and the fallback creation method to locate and implement the change.

…eation

registry.updateSandbox() at Step 4 (inference setup) runs before the
sandbox entry exists in the registry. updateSandbox silently returns
false when the entry is not found (registry.ts line 177), so the model
and provider are never saved. registerSandbox() at Step 6 (create
sandbox) later creates the entry without model or provider.
Add a registry.updateSandbox() call after createSandbox() returns, so
the model and provider are written to the entry that now exists.
Before: nemoclaw list shows model: unknown  provider: unknown
After:  nemoclaw list shows model: nvidia/nemotron-3-super-120b-a12b  provider: nvidia-prod
Signed-off-by: Truong Nguyen <tgnguyen@nvidia.com>
@TruongNguyenG TruongNguyenG force-pushed the fix/registry-model-provider branch from 28f1954 to c832a4c Compare April 14, 2026 18:42
@BenediktSchackenberg
Copy link
Copy Markdown
Contributor

Nice find — I hit the same root cause and opened #1884 for this yesterday. Same fix: registry.updateSandbox(sandboxName, { model, provider }) after createSandbox() returns.

I also added a source-order regression test in #1884 to prevent reintroduction. Might be worth checking if the approaches can be consolidated, or one can close in favor of the other. Either way, glad it's getting attention!

@cv cv merged commit 9664257 into NVIDIA:main Apr 14, 2026
11 checks passed
@cv
Copy link
Copy Markdown
Contributor

cv commented Apr 14, 2026

@BenediktSchackenberg @ShevaNguyen merged both! thank you :)

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.

3 participants