Skip to content

Preserve the buffered total deadline across reset preflight #8343

Closed

Description

@lidge-jun

Client or integration

Direct HTTP/API client

Area

Streaming

Summary

For an opted-in canonical buffered Responses request, pre-head reset selection can wait up to 15 seconds before the buffered collector starts its 15-minute total deadline. A long but active upstream stream can therefore outlive the intended total ceiling by the selection time.

Reproduction

  1. Use the implementation proposed in Fix native Responses recovery after prelude-only EOF #8292 with reset recovery enabled and send a self-contained non-streaming Responses request.
  2. Keep the upstream active with lifecycle prelude activity while selection waits near its 15-second bound.
  3. Continue producing activity until the buffered collector reaches its total deadline.
  4. The deadline is measured from collector start rather than the start of selection. Carry an absolute total deadline across both phases and add a deterministic regression.

This is a source-traced finding; a timed end-to-end reproduction has not yet been run.

Version

PR #8292 candidate 0af39c9.

Operating system

All platforms; source-traced, runtime confirmation pending.

Provider and model

Canonical OpenAI-compatible Responses transport; provider-independent source path.

Logs or error output

No runtime log captured.

Screenshots and supporting files

Review of #8292; no runtime capture.

Redacted configuration

Reset recovery enabled; canonical non-streaming Responses request.

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 9, 2026

    @lidge-jun
    OwnerAuthor

    Status (sweep lane): still present at #8292 head cfe670c, and not reproducible on dev because the reset-selection path exists only in #8292.

    In src/server/responses/passthrough-delivery.ts (~L973 on that head), the canonical buffered branch calls bufferedResponsesReadOptions(stallTimeoutMs) after the upstream response has been selected. startedAt defaults to Date.now() (buffered-sse-json.ts:75), so the 15-minute total deadline starts at collector start instead of at the start of reset selection. The fix is to capture an absolute deadlineAt (or startedAt) before selection begins and pass it into bufferedResponsesReadOptions / read.deadlineAt. A deterministic regression would hold selection near its 15 s bound with a fake clock and assert the collector times out at selectionStart + total.

    This is blocked on #8292 landing (or that lane folding it in); the sweep lane is not pushing to #8292's branch.

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