Skip to content

[Bug] DeepSeek V4 Flash still returns local 502 after inter-chunk JSON stall in v2.10.2 #1172

Closed as not planned

Description

@simon1561

Follow-up to #1065

This is a follow-up to #1065 and the fix in #1088. The first-byte deadline change is working, but the remaining inter-chunk inactivity limit can still turn a valid DeepSeek V4 Flash turn into a local 502.

Client or integration

Codex App through OpenCodex

Environment

  • OpenCodex: 2.10.2
  • Platform: macOS
  • Provider: built-in deepseek
  • Model: deepseek-v4-flash
  • Inbound protocol: Responses
  • Reasoning effort: max
  • Current official registry route: bounded non-streaming JSON upstream, then Responses event synthesis

Observed response

The following sanitized request-log fields were recorded in a real conversation. The prompt, API key, conversation ID, and request ID are intentionally omitted:

{
  "model": "deepseek-v4-flash",
  "provider": "deepseek",
  "inboundProtocol": "responses",
  "requestedModel": "deepseek/deepseek-v4-flash",
  "requestedEffort": "max",
  "status": 502,
  "durationMs": 90241,
  "errorCode": "upstream_server_error",
  "closeReason": "non_stream",
  "upstreamError": "upstream JSON response stalled before completing",
  "usageStatus": "unreported"
}

Why this appears distinct from #1065

PR #1088 gives the first body byte a 180-second allowance while intentionally retaining a 30-second inactivity limit between later body chunks. This failure occurred after the first-byte fix was available and lasted about 90 seconds before the bounded JSON reader returned 502.

The current log does not expose the exact upstream chunk boundaries, but the non_stream close reason and the bounded-JSON error are consistent with a post-first-byte body stall rather than the original early first-byte timeout.

Expected behavior

DeepSeek V4 Flash should either complete the valid Responses turn or return an upstream-specific error. A slow thinking turn should not be converted into a misleading local 502 solely because a later JSON body chunk takes more than 30 seconds.

Suggested investigation

  1. Add phase-safe diagnostics for headers, first byte, and subsequent body chunks without logging prompt or reasoning content.
  2. Confirm whether DeepSeek V4 Flash can legitimately pause for more than 30 seconds while producing a non-streaming JSON response at max effort.
  3. Consider a model-scoped/configurable inter-chunk timeout for this bounded JSON path, while preserving a finite total deadline.
  4. If the native Responses stream now terminates reliably, consider restoring streaming for this model with the existing terminal-event and item-id repairs.

References: #1065, #1088.

Activity

  1. github-actions commented on Aug 7, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: unknown.

  2. github-actions commented on Aug 7, 2026

    @github-actions
    Contributor

    Issue closed: use an issue template

    Thanks for taking the time to submit this issue. It was closed automatically because it was not opened with a recognized issue template (Bug report, Feature request, Documentation, or Provider compatibility). Freeform and API-opened issues cannot skip this check.

    • This issue does not use a recognized issue template.

    Please edit the issue to add:

    • Open a new issue with the Bug report, Feature request, Documentation, or Provider compatibility template.
    • Or edit this issue so the body uses the template section headings for the kind of report you are filing.

    See the Contributing guide for details.

    Once the report passes the automated checks, it will be reopened automatically unless a maintainer has changed its state.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions