fix: resume saved user messages after execution recovery (#13270)

Preserve verified native process-stop evidence and retry saved user messages through normal continuation admission after recovery cleanup. Show the current wait reason and serialize delivery so a saved message starts one fresh turn.

Validated with 410 focused tests, typecheck, build, token gates, all PR CI checks, and Greptile 5/5.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip authored and GitHub committed 2026-09-11 17:12:55 -05:00
1 parent 250deab910
commit 51b0e01ead
17 files changed
+471 -95

No files matched your search

@@ -4119,7 +4119,7 @@ function leaseDb(
returning: () => Promise<Array<{ runId: string }>>;
};
result.returning = () =>
Promise.resolve([{ runId: coordinator.runId }]);
Promise.resolve([{ runId: coordinator.runId, nextEventSeq: 2 }]);
return result;
},
};
@@ -4162,12 +4162,20 @@ function leaseDb(
return query;
},
});
const insert = (table: unknown) => ({
values: (values: Record<string, unknown>) => {
updates.push({ table, values });
return { returning: async () => [values] };
},
});
const tx = {
insert,
execute: async () => [],
select,
update,
};
return {
insert,
select,
transaction: async (operation: (transaction: Db) => Promise<unknown>) =>
operation(tx as unknown as Db),
@@ -6463,13 +6471,16 @@ describe("native process ownership", () => {
highestContiguousSourceSeq: 1,
};
});
state.createBackend.mockImplementationOnce((_input, options) => ({
kind: "test",
onSpawn: options.onSpawn,
}));
const updates: Array<{ table: unknown; values: Record<string, unknown> }> = [];
state.createBackend.mockImplementationOnce((_input, options) => {
expect(updates).toContainEqual({ table: heartbeatRunEvents, values: expect.objectContaining({
eventType: "native.process_start_requested", runId: execution.binding.runId,
}) });
return { kind: "test", onSpawn: options.onSpawn };
});
await executePaperclipNativeSession({
db: leaseDb(),
db: leaseDb(execution, {}, {}, updates),
execution,
runnerInstanceId: "runner",
onSpawn,