Integrate cancellation-save coverage and execution release compatibility

Co-Authored-By: Paperclip <noreply@paperclip.ing>

* codex/work-folders-remote-recovery-refresh:
  test: retain sandbox saves through native startup cancellation
  fix: read cancellation evidence for keyed execution release
  Move preview-upgrade regression coverage to the final acceptance layer
This commit is contained in:
DottaandPaperclip committed 2026-09-12 13:38:32 -05:00
commit f29effb6b0
3 files changed
+160 -99

No files matched your search

+6 -1
View File
@@ -25482,11 +25482,16 @@ export function heartbeatService(
options: { suppressImmediateRecovery?: boolean } = {},
) {
try {
// Some release paths carry only the durable run key. Read authoritative
// cancellation evidence before deciding whether automatic recovery is allowed.
const latestRun = options.suppressImmediateRecovery ? null : await getRun(run.id);
const operatorCancelled = latestRun?.companyId === run.companyId
&& isOperatorCancelledRun(latestRun, latestRun.agentId);
const { postCommitEffects } = await wakeQueue.releaseIssueExecution({
companyId: run.companyId,
runId: run.id,
now: new Date(),
suppressImmediateRecovery: options.suppressImmediateRecovery || isOperatorCancelledRun(run, run.agentId),
suppressImmediateRecovery: options.suppressImmediateRecovery || operatorCancelled,
});
await applyWakeQueuePostCommitEffects(postCommitEffects);
} catch (error) {