Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,28 @@ describe("sandbox crash-recovery replay (#5961, #6228)", () => {
expect(calls.error.mock.calls.flat().join("\n")).toContain("--recreate-sandbox");
});

it("recreates after build or policy drift when explicitly requested (#9297)", async () => {
const session = sessionWithCheckpoint(
crashedCheckpoint({
effectGroups: {
sandbox_create: { completedAt: "2026-01-01T00:00:00.000Z", fingerprint: "stale-build" },
},
}),
);
session.machine.state = "openclaw";
const { deps, calls } = createDeps({ getSandboxReuseState: () => "ready" }, session);

await handleSandboxState({
...baseOptions(deps, session),
resume: true,
sandboxName: "my-assistant",
recreateSandbox: () => true,
});

expect(calls.createSandbox).toHaveBeenCalledOnce();
expect(calls.error).not.toHaveBeenCalled();
});
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

it("rejects reuse when a resolved policy or package input drifted despite an unchanged build version and policy tier (#7022)", async () => {
const { deps, calls } = createDeps({ getSandboxReuseState: () => "ready" });
const session = sessionWithCheckpoint(crashedCheckpoint());
Expand Down
1 change: 1 addition & 0 deletions src/lib/onboard/machine/handlers/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ class SandboxStateFlow<
sandboxName: string,
createIntent: ResolvedSandboxCreateIntent,
): void {
if (this.options.recreateSandbox(false)) return;
const recordedFingerprint = state.session?.checkpoint?.effectGroups.sandbox_create?.fingerprint;
if (!recordedFingerprint) return;
// Older and reuse-backfilled receipts contain the stable create-input prefix.
Expand Down
Loading