mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
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:
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'
|
||||
|
||||
Reference in new issue
Block a user