diff --git a/server/src/services/native-runtime/native-session-executor.test.ts b/server/src/services/native-runtime/native-session-executor.test.ts index fb0650cd6ef..c1b67f1737f 100644 --- a/server/src/services/native-runtime/native-session-executor.test.ts +++ b/server/src/services/native-runtime/native-session-executor.test.ts @@ -19641,6 +19641,8 @@ describe("runnerd provider runtime wiring", () => { ...["resumed", "replacement"].map(outcome => ({ outcome, scenario: "fresh", homeMode: "preconfigured" })), ...["interrupted_bootstrap", "interrupted_bootstrap_other_run", "interrupted_bootstrap_unproven", "interrupted_bootstrap_symlink_parent"] .map(scenario => ({ outcome: "resumed", scenario, homeMode: "isolated" })), + { outcome: "created", scenario: "interrupted_bootstrap", homeMode: "isolated" }, + { outcome: "created", scenario: "interrupted_bootstrap_symlink_parent", homeMode: "isolated" }, ])( "bootstraps only an untouched provider session in a $outcome workspace lease: $scenario ($homeMode)", async ({ outcome, scenario, homeMode }) => { const remoteCwd = join(isolatedStateDirectory, "remote"); diff --git a/server/src/services/native-runtime/native-session-executor.ts b/server/src/services/native-runtime/native-session-executor.ts index 8e006540a3f..c2d683a6cbe 100644 --- a/server/src/services/native-runtime/native-session-executor.ts +++ b/server/src/services/native-runtime/native-session-executor.ts @@ -15674,6 +15674,15 @@ async function createRunnerdBackendWithinSessionClaim( // lease was not provider-confirmed lost. Never silently create a new // provider session from that ambiguous state. throw new Error("runner_harness_state_mismatch: backup_without_reusable_lease"); + } else if (state.incompleteReason === "not_suspended" + && input.restartRecovery?.kind === "bootstrap_incomplete" + && state.notSuspendedRunId === input.execution.binding.runId + && hasRemoteBootstrapRestartProof(input.execution.binding.runId)) { + if (!(await moveInterruptedBootstrapSessionAside() + && takeRemoteBootstrapRestartProof(input.execution.binding.runId) + && await claimUntouchedRemoteSession())) { + throw new Error("runner_harness_state_mismatch: created_not_suspended"); + } } } } else if (remoteTarget && remoteCommandRunner) {