Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
cd74a8a
test(onboard): centralize sandbox identity fixtures
apurvvkumaria Aug 27, 2026
5187132
test(onboard): align managed create identity
apurvvkumaria Aug 27, 2026
94d6e78
test(onboard): bind fixture create attempts
apurvvkumaria Aug 27, 2026
6e5014b
merge(onboard): refresh sandbox fixture changes
apurvvkumaria Aug 27, 2026
e49c4fc
merge: resolve conflicts with main
github-actions[bot] Aug 27, 2026
b0ccca4
merge(onboard): reconcile sandbox identity fixture
apurvvkumaria Aug 27, 2026
156479b
merge(e2e): refresh Brave fixture changes
apurvvkumaria Aug 27, 2026
4af7879
test(onboard): keep managed sandbox identity consistent
apurvvkumaria Aug 27, 2026
2f59c15
merge(onboard): reconcile remote fixture updates
apurvvkumaria Aug 27, 2026
f8c36a0
test(onboard): keep fixture observations consistent
apurvvkumaria Aug 27, 2026
4b594e2
test(onboard): report missing fixture sandbox
apurvvkumaria Aug 27, 2026
00d386b
test(onboard): remove duplicate selector case
apurvvkumaria Aug 27, 2026
30ed049
test(onboard): bound replacement fixture identity
apurvvkumaria Aug 27, 2026
7e736b2
test(onboard): defer shared fixture identity import
apurvvkumaria Aug 27, 2026
ddb456b
test(onboard): reject mismatched fixture gateways
apurvvkumaria Aug 27, 2026
bf28ca1
merge(onboard): reconcile durable identity fixture
apurvvkumaria Aug 27, 2026
b860d15
merge: resolve conflicts with main
github-actions[bot] Aug 27, 2026
783b622
merge(onboard): refresh identity fixture consumers
apurvvkumaria Aug 27, 2026
858e4e9
merge(onboard): preserve fixture identity on current main
apurvvkumaria Aug 27, 2026
c6d2235
merge: resolve conflicts with main
github-actions[bot] Aug 27, 2026
7eb34a2
merge(test): refresh retained runtime improvements
apurvvkumaria Aug 27, 2026
1130ac1
merge(main): integrate host PATH and onboarding fixes
apurvvkumaria Aug 28, 2026
4de2595
test(onboard): route runtime identity through fixture
apurvvkumaria Aug 28, 2026
31b3e0d
merge(main): integrate optional SDK decision
apurvvkumaria Aug 28, 2026
09cd396
test(onboard): complete fixture watch selection
apurvvkumaria Aug 28, 2026
ab01a40
merge: resolve conflicts with main
github-actions[bot] Aug 28, 2026
1f0efbf
merge(main): reconcile sandbox fixture infrastructure
apurvvkumaria Aug 28, 2026
e720637
merge(pr): retain validated fixture resolution
apurvvkumaria Aug 28, 2026
d6a3a76
test(onboard): finish fixture identity cutover
apurvvkumaria Aug 28, 2026
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
2 changes: 1 addition & 1 deletion ci/test-file-size-budget.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test/generation/generate-openclaw-config.test.ts": 1898,
"test/installer-integration/install-preflight.test.ts": 3025,
"test/agents/openclaw/runtime/nemoclaw-start.test.ts": 4626,
"test/onboarding/onboard-messaging.test.ts": 1979,
"test/onboarding/onboard-messaging.test.ts": 1976,
"test/onboarding/onboard-selection.test.ts": 4176
}
}
4 changes: 2 additions & 2 deletions src/lib/onboard/__test-helpers__/sandbox-gpu-create-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ export function createGpuFlowInput(): SandboxGpuCreateFlowInput {
};
}

export function createGpuFlowDeps(): SandboxGpuCreateFlowDeps {
export function createGpuFlowDeps(sandboxId = "alpha-sandbox-id"): SandboxGpuCreateFlowDeps {
return {
runOpenshell: vi.fn((args: string[]) =>
args[0] === "sandbox" && args[1] === "get"
? {
status: 0,
stdout: "Name: alpha\nId: alpha-sandbox-id\nState: Ready\n",
stdout: `Name: alpha\nId: ${sandboxId}\nState: Ready\n`,
stderr: "",
}
: { status: 0, stdout: "", stderr: "" },
Expand Down
9 changes: 5 additions & 4 deletions src/lib/onboard/sandbox-gpu-create-flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,13 @@ describe("runSandboxGpuCreateFlow provider-owned managed create", () => {
intendedWorkloadArgv: launch.intendedSandboxStartupCommand,
expectedSupervisorArgv: ["/mxc/supervisor"],
};
const deps = createDeps();
const sandboxId = "mxc-alpha";
const deps = createDeps(sandboxId);
const adapterOverride = {} as never;
deps.createManagedBootstrapAdapter = vi.fn(() => adapterOverride);
deps.runOpenshell = vi.fn(() => readySandboxGetResult("alpha-sandbox-id"));
deps.runOpenshell = vi.fn(() => readySandboxGetResult(sandboxId));
vi.mocked(deps.runCaptureOpenshell).mockImplementation((args) =>
args[1] === "get" ? "ID: alpha-sandbox-id\n" : "alpha Ready",
args[1] === "get" ? `ID: ${sandboxId}\n` : "alpha Ready",
);
recoverUnfinished.mockRejectedValueOnce(new Error("unfinished recovery failed"));

Expand Down Expand Up @@ -422,7 +423,7 @@ describe("runSandboxGpuCreateFlow provider-owned managed create", () => {
expect(mocks.streamSandboxCreate).not.toHaveBeenCalled();
expect(errorOutput()).toContain("recovery stopped before sandbox 'alpha' was created");
expect(errorOutput()).toContain("Transaction");
expect(errorOutput()).toContain("durable sandbox ID mxc-alpha");
expect(errorOutput()).toContain(`durable sandbox ID ${sandboxId}`);
expect(errorOutput()).toContain("OpenShell's sandbox get command");
expect(errorOutput()).toContain("never delete a runtime by mutable sandbox name");
expect(errorOutput()).toContain("Authorization: Bearer <REDACTED>");
Expand Down
53 changes: 29 additions & 24 deletions test/helpers/managed-image-buildless-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ interface ChildPayload {
agent?: string | null;
dashboardPort?: number | null;
imageTag?: string | null;
lifecycleLiveIdentityFingerprint?: string | null;
name?: string;
workload?: {
schemaVersion?: number;
Expand All @@ -93,6 +94,7 @@ interface ChildPayload {
};
}>;
runnerCommands: string[];
sandboxId: string;
spawnCalls: SpawnCall[];
}

Expand Down Expand Up @@ -149,7 +151,6 @@ const managedBootstrapCalls = [];
const registerCalls = [];
const runnerCommands = [];
const spawnCalls = [];
let sandboxCreated = recreate;
let existingEntryAvailable = recreate;
let registeredSandbox = null;
let managedHermesVolume = recreate ? {
Expand Down Expand Up @@ -193,6 +194,12 @@ const replace = (target, name, value) => {
const childProcess = require("node:child_process");
const fixtureMocks = require(${source("test/helpers/onboard-script-mocks.cjs")});
fixtureMocks.mockStandaloneGatewayTeardownAuthority();
const createdSandbox = fixtureMocks.createCreatedSandboxFixture({
sandboxName,
sandboxId: "fixture-managed-sandbox",
lifecycleState: recreate ? "created" : "absent",
});
createdSandbox.installRuntimeObservation();

const coreVersion = require(${source("src/lib/core/version.ts")});
replace(coreVersion, "getVersion", () => catalogRelease);
Expand Down Expand Up @@ -420,16 +427,16 @@ runner.run = (command, options = {}) => {
const argv = Array.isArray(command) ? command.map(String) : [];
const normalized = normalize(command);
runnerCommands.push(normalized);
sandboxCreated = normalized.includes("sandbox delete") ? false : sandboxCreated;
existingEntryAvailable = normalized.includes("sandbox delete") ? false : existingEntryAvailable;
if (
normalized.includes("sandbox delete") &&
createdSandbox.state.lifecycleState === "created"
) {
createdSandbox.delete();
existingEntryAvailable = false;
}
if (/(?:^|\s)docker(?:\s+buildx)?\s+build(?:\s|$)/u.test(normalized)) {
return poison("docker build");
}
if (normalized.includes("sandbox get") && normalized.includes(sandboxName)) {
return sandboxCreated
? { status: 0, stdout: "Name: " + sandboxName + "\nId: fixture-managed-sandbox\n", stderr: "" }
: { status: 1, stdout: "", stderr: "sandbox not found" };
}
if (argv[0] === "docker" && argv[1] === "volume") {
const volumeName = argv.at(-1);
if (argv[2] === "inspect") {
Expand All @@ -449,16 +456,13 @@ runner.run = (command, options = {}) => {
return { status: 0, stdout: volumeName + "\n", stderr: "" };
}
}
return { status: 0, stdout: "", stderr: "" };
return createdSandbox.run(command) ?? { status: 0, stdout: "", stderr: "" };
};
runner.runFile = (file, args = []) => runner.run([file, ...args]);
runner.runCapture = (command) => {
const normalized = normalize(command);
runnerCommands.push(normalized);
const createdIdentity = fixtureMocks.mockCreatedSandboxIdentityList(command, {
sandboxName,
sandboxId: "fixture-managed-sandbox",
});
const createdIdentity = createdSandbox.capture(command);
if (createdIdentity !== null) return createdIdentity;
if (normalized.includes("policy get") && normalized.includes("--output json")) {
return JSON.stringify({
Expand All @@ -474,12 +478,6 @@ runner.runCapture = (command) => {
if (normalized.includes("gateway info")) {
return "Gateway endpoint: http://127.0.0.1:8080";
}
if (normalized.includes("sandbox get") && normalized.includes(sandboxName)) {
return sandboxCreated
? "Name: " + sandboxName + "\nId: fixture-managed-sandbox\nState: Ready"
: "";
}
if (normalized.includes("sandbox list")) return sandboxName + " Ready";
if (normalized.includes("forward list")) {
return sandboxName + " 127.0.0.1 18789 23189 running";
}
Expand Down Expand Up @@ -543,7 +541,7 @@ const sourceEntry = recreate ? fixtureMocks.managedSandboxPolicyReceiptFixture({
credentialProxyReplayRequired: true,
shared: true,
},
}, { sandboxName, sandboxId: "fixture-managed-sandbox" }) : null;
}, { sandboxName, sandboxId: createdSandbox.state.sandboxId }) : null;
registry.getSandbox = () => registeredSandbox ?? (existingEntryAvailable ? sourceEntry : null);
registry.getDefault = () => null;
registry.listExtraProviders = () => [];
Expand Down Expand Up @@ -578,7 +576,13 @@ childProcess.spawn = (command, args = [], options = {}) => {
if (/(?:^|\s)docker(?:\s+buildx)?\s+build(?:\s|$)/u.test(normalized)) {
return poison("docker build");
}
if (normalized.includes("sandbox create")) sandboxCreated = true;
if (normalized.includes("sandbox create")) {
if (createdSandbox.state.lifecycleState === "deleted") {
createdSandbox.recreate([command, ...argv]);
} else {
createdSandbox.create([command, ...argv]);
}
}
spawnCalls.push({ command: String(command), args: argv });
const child = new EventEmitter();
child.stdout = new EventEmitter();
Expand Down Expand Up @@ -625,6 +629,7 @@ const { createSandbox } = require(${source("src/lib/onboard.ts")});
managedBootstrapCalls,
registerCalls,
runnerCommands,
sandboxId: createdSandbox.state.sandboxId,
spawnCalls,
}));
})().catch((error) => {
Expand All @@ -645,9 +650,6 @@ function writeRuntimeStubs(fakeBin: string, dockerLog: string): void {
'if [ "${1:-}" = "policy" ] && [ "${2:-}" = "list" ] && [[ " $* " = *" --global "* ]]; then',
' printf "%s\\n" "No global policy history found" >&2',
"fi",
'if [ "${1:-}" = "sandbox" ] && [ "${2:-}" = "get" ]; then',
' printf "Sandbox:\\n\\n Id: fixture-managed-sandbox\\n Name: %s\\n Phase: Ready\\n" "${!#}"',
"fi",
"exit 0",
"",
].join("\n"),
Expand Down Expand Up @@ -878,6 +880,9 @@ function assertManagedLaunch(
)}`,
).toBeDefined();
expect(registration?.agent).toBe(agent);
expect(registration?.lifecycleLiveIdentityFingerprint).toBe(
createHash("sha256").update(result.payload.sandboxId).digest("hex"),
);
if (agent === "langchain-deepagents-code") {
expect(registration?.dashboardPort).toBe(0);
}
Expand Down
Loading
Loading