Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/onboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5251,6 +5251,7 @@ async function onboard(opts = {}) {
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.

onboardSession.markStepComplete("sandbox", { sandboxName, provider, model, nimContainer });
}

Expand Down
Loading