Summary
OpenCode intermittently fails on the OpenAI provider with:
Service Unavailable: upstream connect error or disconnect/reset before headers. reset reason: remote connection failure
Some requests succeed, while others repeatedly fail and display automatic retries. Rebooting the computer and reconnecting OpenAI authentication did not resolve the problem.
Environment
- OpenCode: 1.18.33 (verified with opencode --version)
- OS: Linux
- Provider: openai
- Affected model IDs observed in logs: gpt-5.6-sol, gpt-6-sol, gpt-6.1-sol
- Runtime reported in logs: ai-sdk
Observed behavior and evidence
- Failures occurred across multiple conversations on 2026-09-30, rather than only one session.
- Logs repeatedly report AI_APICallError: Service Unavailable.
- In one affected conversation, OpenCode read three PNG screenshots, then the next gpt-6.1-sol request failed at 09:40:49 UTC.
- Subsequent retries sometimes failed in under one second.
- Other conversations continued executing tools around the same period, consistent with intermittent rather than universal failure.
- Two distinct run IDs were issuing requests for the same affected session around 09:41–09:43 UTC. This is an observation only; its relevance to the failure is unknown.
Sanitized excerpt:
2026-09-30T09:40:40.581Z stream providerID=openai modelID=gpt-6.1-sol
2026-09-30T09:40:40.586Z llm.runtime=ai-sdk llm.provider=openai llm.model=gpt-6.1-sol
2026-09-30T09:40:49.367Z stream error: AI_APICallError: Service Unavailable
2026-09-30T09:40:51.395Z stream providerID=openai modelID=gpt-6.1-sol
2026-09-30T09:40:51.825Z stream error: AI_APICallError: Service Unavailable
2026-09-30T09:40:56.236Z stream providerID=openai modelID=gpt-6.1-sol
2026-09-30T09:40:56.389Z stream error: AI_APICallError: Service Unavailable
Reproduction
- Use an OpenAI model in OpenCode for a coding conversation with tool use.
- Continue working normally.
- Intermittently, a request fails with the error above and automatic retries also fail.
The failure is not reliably reproducible on demand. Reading images preceded one failure, but failures in other conversations mean images are not established as the cause.
Expected behavior
Requests complete normally, or transient failures recover with actionable diagnostics identifying the failed endpoint, HTTP status, and provider request ID when available.
Troubleshooting already attempted
- Rebooted the computer.
- Reconnected OpenAI authentication.
- Retried/continued the conversation.
- Inspected local logs and confirmed failures across models and conversations.
A controlled MCP-enabled versus MCP-disabled comparison has not yet been performed. The root cause is not established; this report does not assume a provider outage, tool-count problem, or overlapping-run problem.
Related reports
Is this a known OpenAI integration or retry/recovery issue in 1.18.33? What additional sanitized diagnostics would help distinguish a gateway connection failure from a request-specific problem?
Summary
OpenCode intermittently fails on the OpenAI provider with:
Some requests succeed, while others repeatedly fail and display automatic retries. Rebooting the computer and reconnecting OpenAI authentication did not resolve the problem.
Environment
Observed behavior and evidence
Sanitized excerpt:
Reproduction
The failure is not reliably reproducible on demand. Reading images preceded one failure, but failures in other conversations mean images are not established as the cause.
Expected behavior
Requests complete normally, or transient failures recover with actionable diagnostics identifying the failed endpoint, HTTP status, and provider request ID when available.
Troubleshooting already attempted
A controlled MCP-enabled versus MCP-disabled comparison has not yet been performed. The root cause is not established; this report does not assume a provider outage, tool-count problem, or overlapping-run problem.
Related reports
Is this a known OpenAI integration or retry/recovery issue in 1.18.33? What additional sanitized diagnostics would help distinguish a gateway connection failure from a request-specific problem?