fix: keep codex sessions reusable after turn failures

This commit is contained in:
Codex
2026-06-03 00:28:41 +08:00
parent c51180eef6
commit f69ef55ddc
5 changed files with 79 additions and 11 deletions
+12
View File
@@ -85,6 +85,18 @@ for await (const line of rl) {
respond(message.id, { turn });
continue;
}
if (mode === "slow-progress-before-terminal") {
turnCounter += 1;
const turn = { id: `turn_selftest_${turnCounter}`, status: "completed" };
notify("turn/started", { turn: { id: turn.id, status: "running" } });
respond(message.id, { turn: { id: turn.id, status: "running" } });
setTimeout(() => notify("item/agentMessage/delta", { itemId: "msg_slow_progress", delta: "still working" }), 40);
setTimeout(() => {
notify("item/completed", { item: { id: "msg_slow_progress", type: "agentMessage", text: "slow progress final" } });
notify("turn/completed", { turn });
}, 90);
continue;
}
if (mode === "provider-503-terminal") {
turnCounter += 1;
const turn = { id: `turn_selftest_${turnCounter}`, status: "failed", error: { message: "HTTP 503 Service Unavailable" } };