fix(responses): use protocol-neutral keepalive before response starts - #8948
fix(responses): use protocol-neutral keepalive before response starts#8948tufw95 wants to merge 3 commits into
Conversation
018ccc7 to
c2ff95a
Compare
|
Follow-up commit Evidence: NAS logs showed repeated Codex Focused tests:
Not merged or deployed. |
bfb0901 to
2269b20
Compare
|
Amended follow-up commit to 2269b20 (same patch; removed unused helper parameter). Tests unchanged: 15 focused Codex tests pass. |
Problem
The Responses endpoint emitted a synthetic
rs_omniroute_keepalivereasoning item while waiting for a slow provider. That item hadresponse.output_item.addedand summary events but noresponse.output_item.done. Codex can therefore keep the turn in a running state (spinner/pause) after the real response emitsresponse.completed.Fix
Use the existing SSE comment heartbeat for the Responses startup frame. Comments keep the HTTP connection alive without creating a fake response/output item or polluting the Responses lifecycle. The route continues to forward real
response.createdandresponse.completedevents unchanged.Also add coverage for the observed nested
response.failed+server_is_overloadedSSE shape so the HTTP Codex capacity fallback converts it to 503.Verification
DISABLE_SQLITE_AUTO_BACKUP=true node --import tsx/esm --import ./open-sse/utils/setupPolyfill.ts --test tests/unit/early-stream-keepalive.test.ts(17 passing)node --import tsx/esm --test tests/unit/early-stream-keepalive.test.ts tests/unit/codex-sse-capacity-fallback.test.ts(21 passing)git diff --check