fix(codex): harden streaming timeouts + Responses terminal events

Raise stall/connect timeouts to 60s (configurable per-provider), accept
codex response.done, and always emit a terminal response.failed + [DONE]
for Responses passthrough when a stream closes, stalls, or aborts before
a terminal event — preventing codex clients from hanging.

Co-authored-by: jonathanli12 <jonathanli12@users.noreply.github.com>
Co-authored-by: rifuki <rifuki@users.noreply.github.com>
Co-authored-by: nguyenha935 <nguyenha935@users.noreply.github.com>
Co-authored-by: trananhtung <trananhtung@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
decolua
2026-06-06 16:07:43 +07:00
parent f161b295a5
commit 9caea88528
15 changed files with 311 additions and 30 deletions

View File

@@ -27,7 +27,7 @@ function processSSEMessage(msg, state) {
state.created = parsed.response?.created_at || state.created;
} else if (eventType === "response.output_item.done") {
state.items.set(parsed.output_index ?? 0, parsed.item);
} else if (eventType === "response.completed") {
} else if (eventType === "response.completed" || eventType === "response.done") {
state.status = "completed";
if (parsed.response?.usage) {
state.usage.input_tokens = parsed.response.usage.input_tokens || 0;