mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
fix(sandbox): recreate orphaned microVMs with --replace
A session VM create that fails partway leaves an orphaned msb sandbox that msb ls omits but every later create rejects as already existing, so the session could never get a VM again. Retry the create once with --replace when msb reports the name already exists.
This commit is contained in:
1 parent
052218d5d6
commit
27c673d830
4 files changed
+123
-6
No files matched your search
@@ -214,7 +214,7 @@ function parseSandboxNamedMountSpec(spec: string): { name: string; guest: string
|
||||
return { name, guest }
|
||||
}
|
||||
|
||||
export function buildSandboxCreateArgs(spec: SandboxVmSpec): string[] {
|
||||
export function buildSandboxCreateArgs(spec: SandboxVmSpec, options: { replace?: boolean } = {}): string[] {
|
||||
const tmpfsSizeMib = resolveSandboxRuntimeTmpfsSizeMib(spec.memoryMib)
|
||||
if (tmpfsSizeMib === null) throw new Error('sandbox memory must be positive to size the runtime tmpfs')
|
||||
const workdir = spec.projectMounts[0]
|
||||
@@ -222,6 +222,7 @@ export function buildSandboxCreateArgs(spec: SandboxVmSpec): string[] {
|
||||
return [
|
||||
'run',
|
||||
'-d',
|
||||
...(options.replace === true ? ['--replace'] : []),
|
||||
'--name',
|
||||
spec.name,
|
||||
'--label',
|
||||
|
||||
Reference in new issue
Block a user