Skip to content

Go Responses: Codex DeepSeek V4.1 Flash returns 503 while minimal streaming requests succeed #57983

Open

Description

@competenza-ai

Description

OpenCode Go repeatedly returns 503 Upstream request failed: Endpoint is unavailable. for an existing Codex conversation. Minimal Responses requests with the same workspace key, model, endpoint, and session/thread header values complete successfully, including streaming. This is a native-request compatibility report; the cause is not established.

Environment

  • Windows 11 Pro; Codex desktop 26.1016.6573.0, backend codex-cli 0.163.0-alpha.11.
  • Go subscription; workspace Regions set to Global.
  • POST https://opencode.ai/inference/go/openai/v1/responses, model deepseek-v4.1-flash, wire_api = "responses", WebSockets disabled.
  • API-key permission: Restricted / Models Request. The same key succeeded in the control requests.

Observed comparison

Request Result Cloudflare Ray ID
Minimal non-streaming, Avast Web Guard off 200, completed a4e4cc624faa901a-BOS
Same minimal request, Web Guard on 200, completed a4e4d01468ca83fb-BOS
Minimal streaming, Web Guard on 200, response.completed, no failed event a4e4d820ea32052b-CLT
Existing conversation, native Codex capture 503 before model output a4e4e18b4dcc3d59-JAX
Subsequent native Desktop attempt 503 before model output a4e4e3db588a8fa3-BOS

The bounded native capture ran on 2026-10-22, 01:55:37–01:55:40 UTC (02:55 Lisbon), using the installed Desktop backend executable and existing conversation history through native CLI resume. HTTP and stream retries were both set to zero for that invocation. This was not a Desktop wire capture. Persistent provider settings were unchanged. Web Guard was enabled; its interception certificate was observed during the successful streaming control.

Captured request differences

The successful control used a short input, max_output_tokens: 32, and no tools or explicit reasoning setting. The failing native request has:

  • stream: true, reasoning: {"effort":"none"}, store: false, include: ["reasoning.encrypted_content"].
  • tool_choice: "auto", parallel_tool_calls: true; no explicit output-token limit.
  • 41 input items: 38 messages and 3 function_call_output items, with no function_call items in the captured input.
  • All three tool-result items have name and namespace, but no call_id. One redacted example is below.
  • 27 top-level tools: 11 functions and 16 namespaces. Local trace payload size: 514,795 bytes; prompt and tool definitions are omitted from this public report.
{
  "type": "function_call_output",
  "id": "fco_redacted",
  "name": "send_message_to_thread",
  "namespace": "codex_app",
  "output": "[redacted]"
}

Reproduction and question

The failure reproduces on this existing native conversation. A minimal request does not reproduce it; the redacted excerpt above is evidence of the shape, not a tested minimal reproducer. No session-binding reset, model substitution, proxy, or history editing was used.

Could you inspect the failing Ray IDs and distinguish upstream endpoint availability from unsupported/malformed native request items? In particular, are the tool-result form without call_id, namespaced tools, or disabled reasoning rejected by this Responses route? If rejected, a specific validation error would help instead of the generic endpoint-unavailable response.

Related reports: #53120 (older model alias/route and conversation-specific failures) and #57613 (same current model, other hosted-service failures). Neither establishes this report's cause.

No API keys, account identifiers, original prompts, tool descriptions, or local paths are included. The complete original trace remains local.

Activity

  1. opencode-agent commented on Oct 22, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed and carefully redacted report. I think this is a duplicate of #53120. Both are about the same problem: a persistent 503 Upstream request failed: Endpoint is unavailable. on OpenCode Go's /v1/responses for one existing Codex conversation with DeepSeek Flash, while minimal requests and other conversations with the same key and model succeed. #53120 has since been reproduced on demand, and the suspected cause there is the gateway pinning each conversation to an upstream provider (stickyProvider: "strict") without failover. That would also fit a conversation-specific failure like yours.

    Possible duplicates and related issues, ordered by likelihood:

    Your Ray IDs and the request-shape details (tool results without call_id, namespaced tools, reasoning.effort: none) would be useful evidence on #53120.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. competenza-ai commented on Oct 22, 2026

    @competenza-ai
    Author

    Follow-up: isolated the failing input records

    A controlled replay now narrows the trigger beyond the original report. Both variants used the same captured native request, key, endpoint, model, session/thread headers, full tool definitions, reasoning settings, and streaming. Avast Web Guard remained enabled. A max_output_tokens: 32 limit was added equally to both variants, and automatic retries were disabled.

    Captured-request variant Result Cloudflare Ray ID
    All 41 input items, including the three function_call_output records 503 server_error, Endpoint is unavailable a4e4f21c1f498c7f-BOS
    Remove only those three records; retain the other 38 inputs and all tools/settings 200 stream, response.completed, output present, no failed event a4e4f43f68a767b0-BOS

    The first cleaned replay also received HTTP 200 (a4e4f29aac422fc4-BOS), but its initial collector truncated the large stream before it could verify completion; the completed result above was separately verified with an incremental SSE reader.

    A small independent control gave the same split: the three records plus one ordinary user message returned 503 (a4e4ee36c8de902f-BOS), whereas the same message-array request without those records completed (a4e4ef090c2aada8-BOS). The tool-result output strings in that small probe were replaced with neutral diagnostic text.

    Each suspect record has type: function_call_output, id, name: send_message_to_thread, namespace: codex_app, and string output, but no call_id. No corresponding function_call exists in the captured input. The three records appear as coordinator-to-chat message deliveries in the local history.

    This identifies a reproducible input-dependent trigger in these tests. The original Codex history was not edited, and no native-chat repair is claimed. Could the gateway validate this unsupported/unmatched tool-result shape explicitly rather than returning an upstream-availability 503? It may also require coordination with Codex's handling of inter-chat message records.

    No secrets or original prompt contents are included.

  3. opencode-agent commented on Oct 23, 2026

    @opencode-agent
    Contributor

    We haven't heard back in the past day, so I'm closing this as a duplicate of #53120. That issue covers the same problem: a persistent 503 Upstream request failed: Endpoint is unavailable. on OpenCode Go's /v1/responses for one Codex conversation with DeepSeek Flash, while other requests succeed. Please follow #53120 for updates. Your Ray IDs and request-shape details (tool results without call_id, namespaced tools, reasoning.effort: none) would be useful evidence there. If your problem turns out to be different, reply here and we can reopen it.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions