fix: validate persisted warm origin run identity

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-10 12:27:56 -05:00
1 parent cfa2b81539
commit ce107d4710
2 files changed
+4 -1

No files matched your search

@@ -4397,6 +4397,7 @@ export async function verifyPriorRunnerdStateForSessionScope(input: {
// workspace coordinate. Resolve that recorded origin, never an arbitrary
// run ID, before checking the physical lease and latest retirement.
const origins = await input.db.select({
id: heartbeatRuns.id,
status: heartbeatRuns.status,
runnerProfileJson: heartbeatRuns.runnerProfileJson,
}).from(heartbeatRuns).where(and(
@@ -4412,6 +4413,7 @@ export async function verifyPriorRunnerdStateForSessionScope(input: {
const originExecution = parseNativeExecutionInput(originProfile.nativeExecutionInput);
const originWorkspace = readNativeComputerWorkspaceReference(originProfile.nativeComputerWorkspace);
if (!TERMINAL_HEARTBEAT_RUN_STATUSES.has(origin.status) ||
originExecution.binding.runId !== origin.id ||
originExecution.binding.executionWorkspaceId !== input.identity.environmentLeaseId ||
nativeSessionScopeKey(originExecution) !== nativeSessionScopeKey(priorExecution) ||
!originWorkspace || originWorkspace.remoteCwd !== priorWorkspace.remoteCwd ||