Skip to content

OpenAI Responses reasoning-only stream failures retry forever and block parent tasks #37258

Description

@fanxing2501

Description

An explore subagent using the official openai/gpt-5.6-sol Responses provider with the xhigh variant retried the same final LLM call indefinitely after all tool calls had completed. The parent task remained running until manual cancellation.

The final assistant message accumulated 25 attempts over about 63 minutes. A typical attempt produced reasoning for 110-117 seconds, emitted 13 reasoning items, then failed without any text or step-finish. The next request used the original stream input, so the model repeated the same planning instead of continuing from the partial reasoning.

Sanitized observations:

completed local tools: 15:23:56
final assistant message: text parts=0, step-finish parts=0
full attempts: usually 13 reasoning items and ~49k encrypted-reasoning characters
retry delays: 2s -> 4s -> 8s -> 16s -> 30s cap
parent task state: running until manually aborted at 16:27

AI_APICallError: Cannot connect to API: The socket connection was closed unexpectedly.

OpenCode caps this model's per-step output at 32k by default while the model advertises 128k. It is possible that xhigh reasoning consumed the request budget, but no normal response.incomplete / finish=length was recorded. At least one attempt logged the socket-close error above. A throttled 320-second HTTPS download through the same network path completed normally, so there was no general 120/300-second active TCP cutoff.

Expected behavior:

  • A normal response.incomplete should finish the step as length and preserve partial output.
  • A retryable transport failure should have a bounded retry count or elapsed-time budget.
  • Exhausted retries must terminate the child task with an error so the parent does not wait forever.

Related but not identical: #12234 (unbounded retries), #29363 (32k reasoning with zero text), #11865 (OpenAI/xhigh subagents hang), and #21979 (Responses failures leave parents waiting).

Plugins

None

OpenCode version

1.18.2

Steps to reproduce

  1. Use the official openai/gpt-5.6-sol provider with variant xhigh.
  2. Start an explore subagent with a broad repository-analysis task that performs several tool calls and then needs to produce a detailed final report.
  3. If the final Responses stream ends after partial reasoning without a terminal event, inspect the child session or logs.
  4. Observe repeated stream providerID=openai ... agent=explore calls for the same assistant message, no final text/step-finish, and the parent task remaining running.

The upstream socket failure is intermittent, but once it occurs the session-level retry loop is deterministic and unbounded.

Screenshot and/or share link

No public share link because the session contains private repository context. Sanitized metrics and the exact error are included above.

Operating System

Ubuntu 26.04 LTS, Linux 7.0.0-27-generic

Terminal

OpenCode TUI over SSH (xterm-256color)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions