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

@@ -213,6 +213,21 @@ describeEmbeddedPostgres("issue queued-comment routes", () => {
return queueRunId;
}
it("projects the recovery wait reason only while the message is deferred", async () => {
const seeded = await seedQueue();
const executionWait = { reason: "remote_cleanup", message: "Waiting for the previous environment to stop." };
await db.update(agentWakeupRequests).set({
payload: sql`coalesce(${agentWakeupRequests.payload}, '{}'::jsonb) || ${JSON.stringify({ executionWait })}::jsonb`,
}).where(eq(agentWakeupRequests.id, seeded.wakeId));
const waiting = await request(app(seeded.companyId)).get(`/api/issues/${seeded.issueId}/queued-comments`);
expect(waiting.status).toBe(200);
expect(waiting.body.executionWait).toEqual(executionWait);
await promoteQueue(seeded);
const admitted = await request(app(seeded.companyId)).get(`/api/issues/${seeded.issueId}/queued-comments`);
expect(admitted.status).toBe(200);
expect(admitted.body.executionWait).toBeUndefined();
});
it("returns the authoritative order, preserves full Markdown edits, and rejects stale revisions", async () => {
const seeded = await seedQueue();
const initial = await request(app(seeded.companyId))