fix: recognize missing-rollout Codex resume error as stale session

The Codex CLI can return "no rollout found for thread id ..." when
resuming a heartbeat thread whose rollout has been garbage-collected.
Extend isCodexUnknownSessionError() to match this wording so the
existing single-retry path in execute.ts activates correctly.

Add parse.test.ts covering the new pattern, existing stale-session
wordings, parseCodexJsonl, and a negative case.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Brandon Woo 2026-04-06 17:07:11 +09:00
parent 08fea10ce1
commit 15bd2ef349
2 changed files with 51 additions and 1 deletions

View file

@ -67,7 +67,7 @@ export function isCodexUnknownSessionError(stdout: string, stderr: string): bool
.map((line) => line.trim())
.filter(Boolean)
.join("\n");
return /unknown (session|thread)|session .* not found|thread .* not found|conversation .* not found|missing rollout path for thread|state db missing rollout path/i.test(
return /unknown (session|thread)|session .* not found|thread .* not found|conversation .* not found|missing rollout path for thread|state db missing rollout path|no rollout found for thread id/i.test(
haystack,
);
}