feat(sandbox): cache the guest image at startup instead of on first command

Pull the configured guest image in the background when the Manager boots and
when sandbox enforcement is switched on, so a sandboxed command no longer
pays the multi-gigabyte download. msb pull is a no-op once cached, startup is
never blocked by it, and a command racing the pull joins the same in-flight
boot.
This commit is contained in:
Chris Scott committed 2026-08-28 13:05:56 -04:00
1 parent 5beb3432d4
commit 2eba81d524
8 files changed
+82 -12

No files matched your search

@@ -104,11 +104,17 @@ const sandboxRuntimeServiceMock = vi.hoisted(() => ({
SandboxRuntimeService: vi.fn<() => {
isEnabled: () => boolean
stopWorkspaceSandboxForToggle?: () => Promise<void>
prepareWorkspaceSandboxOnBoot?: () => Promise<void>
}>(() => ({ isEnabled: () => false })),
}))
vi.mock('../../src/services/sandbox/runtime', () => ({
SandboxRuntimeService: sandboxRuntimeServiceMock.SandboxRuntimeService,
SandboxRuntimeService: function SandboxRuntimeServiceStub() {
return {
prepareWorkspaceSandboxOnBoot: async () => undefined,
...sandboxRuntimeServiceMock.SandboxRuntimeService(),
}
},
}))
import { promises as fs, accessSync, readdirSync } from 'fs'