Skip to content

[Bug] Combo preflight cannot send keepalives while selecting a streaming response #8326

Closed

Description

@lidge-jun

Client or integration

Direct HTTP/API client

Area

Streaming

Summary

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:

  1. Configure a streaming combo whose selected native Responses upstream sends an initial lifecycle prelude and then remains silent.
  2. Send a streaming Responses request and observe when the HTTP response headers and first bytes reach the client.
  3. 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.

Logs or error output

No live log captured. Source location:

preflight = await preflightComboStreamResponse(response, childLog, undefined, {

Screenshots and supporting files

No live capture yet.

Redacted configuration

A combo selecting an opted-in native Responses provider; no credentials are needed for the source-level finding.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    on Nov 8, 2026
  2. added
    streaming
    on Nov 8, 2026
  3. lidge-jun commented on Nov 10, 2026

    @lidge-jun
    OwnerAuthor

    Rechecked on dev df0e6ccc41: 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:

    1. 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.
    2. 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.
    3. 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.

  4. lidge-jun commented on Nov 15, 2026

    @lidge-jun
    OwnerAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugstreaming

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions