Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 10 additions & 1 deletion src/lib/actions/sandbox/rebuild-mcp-phase.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,19 @@ describe("MCP rebuild retry guidance", () => {
});

expect(error.mock.calls.flat().join("\n")).toContain(
"nemoclaw onboard --resume --tool-disclosure direct --no-observability",
"nemoclaw onboard --resume --name alpha --tool-disclosure direct --no-observability",
);
});

it("names the sandbox on the resume retry form so the printed command is runnable", () => {
const error = vi.spyOn(console, "error").mockImplementation(() => undefined);

printMcpRebuildRetryCommand("alpha", [], "progressive");

const command = error.mock.calls.flat().find((line) => line.includes("onboard --resume"));
expect(command).toContain("nemoclaw onboard --resume --name alpha");
});

it("does not turn inherited observability state into an explicit retry override", () => {
const error = vi.spyOn(console, "error").mockImplementation(() => undefined);

Expand Down
6 changes: 5 additions & 1 deletion src/lib/actions/sandbox/rebuild-mcp-phase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ export function printMcpRebuildRetryCommand(
return;
}
const disclosureArg = toolDisclosure ? ` --tool-disclosure ${toolDisclosure}` : "";
// The recreate fault can land after the sandbox was deleted but before create
// recorded its name, leaving the resumable onboard session with no name to
// resume. Carry --name so this printed command works as written instead of
// failing with "no sandbox name was recorded. Re-run with --name".
console.error(
` 2. Run: ${CLI_NAME} onboard --resume${disclosureArg}${observabilityArg}${dcodeAutoApprovalArg}`,
` 2. Run: ${CLI_NAME} onboard --resume --name ${sandboxName}${disclosureArg}${observabilityArg}${dcodeAutoApprovalArg}`,
);
console.error(` This will recreate sandbox '${sandboxName}'.`);
}
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/rebuild-flow-recovery-cases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ export function registerRebuildFlowRecoveryTests(): void {
},
);
expect(harness.errorSpy).toHaveBeenCalledWith(
expect.stringContaining("onboard --resume --tool-disclosure direct"),
expect.stringContaining("onboard --resume --name alpha --tool-disclosure direct"),
);
});

Expand Down