Fix Codex replacement turn idle flash

This commit is contained in:
Mohamed Boudra
2026-04-22 18:54:20 +07:00
parent 407b4b68b0
commit 89efb007f9
4 changed files with 337 additions and 1 deletions
@@ -10,10 +10,13 @@ export function deriveOptimisticLifecycleStatus(
}
switch (event.type) {
case "turn_completed":
case "turn_canceled":
return "idle";
case "turn_failed":
return "error";
case "turn_canceled":
// A canceled turn can be either a final user cancel or an interrupt before
// a replacement turn starts. The daemon snapshot is authoritative here.
return null;
default:
return null;
}