You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Combo preflight cannot send keepalives while selecting a streaming response #8326
A streaming combo request cannot deliver keepalive comments to the client while combo preflight is waiting to select a child response. A quiet upstream can therefore leave an intermediary with no response headers or bytes until preflight commits a child.
Preserving zero-output failover and the response status requires care: sending headers before selection would change the existing failure contract.
Reproduction
Source-inspected scenario, not yet reproduced against a live HTTP client:
Configure a streaming combo whose selected native Responses upstream sends an initial lifecycle prelude and then remains silent.
Send a streaming Responses request and observe when the HTTP response headers and first bytes reach the client.
In the preexisting base below, executeComboResponses awaits preflightComboStreamResponse in src/server/responses/core-combo.ts before returning the selected response. Its preflight retains control frames while waiting for output, a terminal, a failure or its bounds.
Expected: keep the client connection alive during selection without exposing replayable model output or losing zero-output failover and cancellation semantics.
Version
Source inspected at commit c61e957; this behavior predates #8292.
Operating system
Platform-independent source path; live platform behavior has not yet been measured.
Provider and model
Native Responses via a combo; no provider-specific claim.
Rechecked on devdf0e6ccc41: executeComboResponses still awaits preflightComboStreamResponse (src/server/responses/core-combo.ts:1287) before any response head exists, so a quiet selection sends the client no bytes.
This needs a policy choice before code, because any keepalive commits the HTTP status:
Keep the current contract and document it. Zero-output failover and the real HTTP status stay intact. Intermediaries with short idle limits can still drop the request.
Commit a 200 SSE head and send : keepalive comments once selection has waited longer than a threshold (recommended, behind that threshold). A later all-targets failure would arrive as an in-stream response.failed with the same error code, not as an HTTP 4xx/5xx status. Fast selections keep today's behavior exactly.
Keepalive only for WebSocket ingress, where the status is per frame and committing costs nothing. HTTP clients get nothing.
#8292 lists this as a follow-up and rewrites combo-stream-preflight.ts, so the work should start after #8292 lands. Leaving open for the owner's decision.
Owner decision (lidge-jun, 2026-11-15): option 2. Once combo selection has waited longer than a threshold, commit a 200 SSE head and send : keepalive comments. A later all-targets failure arrives as an in-stream response.failed carrying the same error code. Selections that finish under the threshold keep today's behavior exactly (zero-output failover and the real HTTP status). Implementation follows on top of #8292's combo-stream-preflight.ts rewrite.
Activity
lidge-jun commentedon Nov 10, 2026
Rechecked on
devdf0e6ccc41:executeComboResponsesstill awaitspreflightComboStreamResponse(src/server/responses/core-combo.ts:1287) before any response head exists, so a quiet selection sends the client no bytes.This needs a policy choice before code, because any keepalive commits the HTTP status:
: keepalivecomments once selection has waited longer than a threshold (recommended, behind that threshold). A later all-targets failure would arrive as an in-streamresponse.failedwith the same error code, not as an HTTP 4xx/5xx status. Fast selections keep today's behavior exactly.#8292 lists this as a follow-up and rewrites
combo-stream-preflight.ts, so the work should start after #8292 lands. Leaving open for the owner's decision.lidge-jun commentedon Nov 15, 2026
Owner decision (lidge-jun, 2026-11-15): option 2. Once combo selection has waited longer than a threshold, commit a 200 SSE head and send
: keepalivecomments. A later all-targets failure arrives as an in-streamresponse.failedcarrying the same error code. Selections that finish under the threshold keep today's behavior exactly (zero-output failover and the real HTTP status). Implementation follows on top of #8292'scombo-stream-preflight.tsrewrite.fix(combos): keep the #8326 docs and layout entries inside their budgets
fix(combos): address CodeRabbit on #8326
fix(combos): keep a slow streaming combo selection alive (#8326) (#8763)