You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using OpenCode 1.2.15 with openai/gpt-5.3-codex, I intermittently get streamed JSON errors like:
{"type":"error","sequence_number":2,"error":{"type":"server_error","code":"server_error","message":"An error occurred while processing your request... [retrying in 2s attempt #2]"}}
When this happens, retries may continue but session quality degrades (manual intervention often needed).
This report is specifically about the OpenAI streamed error payload with sequence_number:2 + server_error on gpt-5.3-codex.
Notes
OpenAI status has had multiple Codex/Responses elevated-error incidents recently, so this might be a combination of upstream transient faults + client-side retry UX/resilience behavior.
These issues (which you listed as "related issues checked") appear to overlap significantly with the behavior you're describing. Consider whether your report adds new information beyond what's already tracked there, or if a comment/upvote on an existing issue would be more appropriate.
This report includes a specific streamed payload from OpenAI on openai/gpt-5.3-codex: {"type":"error","sequence_number":2,"error":{"type":"server_error",..."[retrying in 2s attempt #2]"}}
It is specifically about intermittent provider-side server_error envelopes and how retry/recovery behaves afterward in OpenCode.
If maintainers prefer consolidating under an existing issue, I’m fine closing this as duplicate and moving the payload/evidence there. I can also provide additional timestamped DEBUG logs if helpful.
This is intermittent and not reliably reproducible on demand.
I do have a captured real payload from session history: {"type":"error","sequence_number":2,"error":{"type":"server_error","code":"server_error","message":"... [retrying in 2s attempt #2]"}}
Captured in exported session ses_3414e160bffeM7NlG2Ae41uXUQ.
Given intermittency, I’m providing concrete payload + session context rather than deterministic repro steps.
If useful, I can attach a redacted DEBUG log bundle with nearby successful/failing runs and timestamps.
Reacted by Chindriș Mihai - Alexandru, Ahmed Aly, Hubert Bieszczad, Quoc Duong Bui, Yunhao Chen, Nontas, Anna-Lena Roth, André Jonas, Riccardo Salzer, Salloxy and 1 more
Reacted by Lucas, Łukasz Rutkowski, Ahmed Aly, Hubert Bieszczad, Quoc Duong Bui, Nontas, Anna-Lena Roth, André Jonas, Frederik Bosch, Riccardo Salzer and 5 more
has been happened a lot today for me. a thread is even completely dead and each message trigger it. other thread can take some messages before erroring again
Reacted by Quoc Duong Bui, Ahmed Aly, Hubert Bieszczad, cd-ducle, Nontas, Anna-Lena Roth, Riccardo Salzer, Rei, Salloxy, brennandai and 1 more
So I am getting these errors as well a bit randomly on 5.4 but consistently and always on GPT-5.5. Every prompt I send just fails, while Codex works no problem.
This is also only happening on my employer's Enterprise (EU) OpenAI account, and on my other account I see no such problem at all.
What I found so far is that, for whatever reason, OpenAI is validaging "originator" and "User-Agent" headers on one of the accounts, and refusing to serve OpenCode, while serving Codex requests properly.
gpt-5.5 fails in OpenCode on our enterprise account, while the same account works in Codex.
We traced this to the HTTP requests sent to the ChatGPT Codex backend. OpenCode and Codex hit the same backend with the same account and equivalent minimal payload, but they identify themselves differently via these headers:
- originator
- User-Agent
Observed behavior:
- OpenCode-style headers:
- originator: opencode
- User-Agent: opencode/...
- result: backend server_error
- Codex-style headers:
- originator: codex_cli_rs
- User-Agent: codex_cli_rs/...
- result: request succeeds
We also isolated the variables:
- changing only originator was not enough
- changing only User-Agent was not enough
- changing both to Codex-style made the same gpt-5.5 request succeed
Conclusion:
OpenCode on our enterprise account does not work with gpt-5.5, but Codex does. The failure is tied to how the client identifies itself to the backend, specifically through originator and User-Agent. The most likely explanation is that OpenAI is intentionally allowing gpt-5.5 for first-party Codex clients while blocking or not supporting it for non-Codex agents such as OpenCode on this account.
I have tested the requests manually, they consistently fail with gpt-5.5 and "opencode" originator/User-Agent, but succeed if I spoof it to be "codex_cli_rs" (for User-Agent it's a longer string).
These headers (User-Agent and originator) do not appear to be configurable within OpenCode, bue even if they were, I do not know if we're safe overriding it.
I do not see a configuration option in the account I have access to to disable/enable it, but maybe someone knows how to disable that header checking so I can keep using OpenCode at work that would be great...
Opened #30323 rebased on current dev with broader OpenAI/Codex stream error coverage (stream_read_error, overload, rate limit), including parseStreamError, retryable(), and fromError(Error.message) paths plus regression tests. Would appreciate a 👍/review if this matches what you are seeing — especially for Codex gpt-5.x unattended runs.
Environment: OpenCode CLI 1.17.11 on Linux, using the OpenAI provider with gpt-5.5.
环境:Linux 、 OpenCode CLI 1.17.11、 OpenAI provider、gpt-5.5。
I noticed that this issue may be related to having too many MCP servers enabled.
我注意到这个问题可能和启用了过多的 MCP server 有关。
Some MCP servers register a large number of tools, which may exceed certain OpenAI-side limits or trigger unstable behavior (not sure).
某些 MCP server 会注册大量工具,这可能会超过 OpenAI 侧的某些限制,或触发不稳定行为 (不确定)。
In my case, the error seemed to happen when the model was about to use tools.
就我而言,错误似乎是在模型准备调用工具时发生的。
I am not sure yet whether the same issue also exists in Codex CLI.
我目前还不确定 Codex CLI 是否也存在同类问题。
After I used the /mcps command to disable some unnecessary MCP servers, especially the ones registering many tools, it started working normally again.
我使用 /mcps 命令禁用了一些不必要的 MCP server(尤其是会注册大量工具的 MCP server) 之后,它就恢复正常了。
If you are seeing similar errors, it may be worth trying to disable unnecessary MCP servers and reduce the total number of registered tools.
如果你遇到了类似的错误,可以尝试禁用不必要的 MCP server,减少已注册工具的总数量。
Activity
github-actions commentedon Mar 5, 2026
This issue might be a duplicate of existing issues. Please check:
These issues (which you listed as "related issues checked") appear to overlap significantly with the behavior you're describing. Consider whether your report adds new information beyond what's already tracked there, or if a comment/upvote on an existing issue would be more appropriate.
chindris-mihai-alexandru commentedon Mar 5, 2026
I reviewed #12234, #12750, and #6983.
Why I filed separately:
openai/gpt-5.3-codex:{"type":"error","sequence_number":2,"error":{"type":"server_error",..."[retrying in 2s attempt #2]"}}StreamIdleTimeoutError(Infinite retry loop when StreamIdleTimeoutError occurs during tool input generation #12234) and not only agent reset behavior (Agent resets to Build after streaming error #12750).server_errorenvelopes and how retry/recovery behaves afterward in OpenCode.If maintainers prefer consolidating under an existing issue, I’m fine closing this as duplicate and moving the payload/evidence there. I can also provide additional timestamped DEBUG logs if helpful.
chindris-mihai-alexandru commentedon Mar 5, 2026
Additional triage data:
{"type":"error","sequence_number":2,"error":{"type":"server_error","code":"server_error","message":"... [retrying in 2s attempt #2]"}}ses_3414e160bffeM7NlG2Ae41uXUQ.Given intermittency, I’m providing concrete payload + session context rather than deterministic repro steps.
If useful, I can attach a redacted DEBUG log bundle with nearby successful/failing runs and timestamps.
chindris-mihai-alexandru commentedon Mar 5, 2026
Update: I exported and redacted evidence from historical sessions/logs.
Prepared artifacts:
opencode-error-snippets.txt(capturedsequence_number:2+server_error+ retry envelope from exported session)opencode-debug-snippets.txt(sanitized timestamp/model/session/error summary lines)opencode-session-ses_3414e160bffeM7NlG2Ae41uXUQ.json(redacted session export)I can attach these if maintainers want the full bundle in this thread.
chindris-mihai-alexandru commentedon Mar 5, 2026
Superseding my prior note — attaching the redacted evidence inline now.
opencode-error-snippets.txtopencode-debug-snippets.txtI also have a fully redacted session export (
opencode-session-ses_3414e160bffeM7NlG2Ae41uXUQ.json) ready if needed.chindris-mihai-alexandru commentedon Mar 5, 2026
Attached the redacted session JSON as a secret gist:
This is
opencode-session-ses_3414e160bffeM7NlG2Ae41uXUQ.jsonreferenced above.Techie5879 commentedon Mar 10, 2026
Seeing similar issues with gpt-5.4-high
kiyoakii commentedon Apr 22, 2026
getting the same errors now with gpt-5.4-high
mirsella commentedon Apr 22, 2026
has been happened a lot today for me. a thread is even completely dead and each message trigger it. other thread can take some messages before erroring again
0verhead commentedon Apr 22, 2026
This morning this issue started happening to me constantly. It is basically unusable right now.
mirsella commentedon Apr 22, 2026
codex cli is working perfectly fine in the meantime
Salloxy commentedon Apr 27, 2026
Same issue. Started happening today in OpenCode Windows
rekram1-node commentedon Apr 27, 2026
This should only happen on transient api errors from their server
kiyoakii commentedon Apr 27, 2026
at least opencode should retry? I've had moments where it's nearly not usable.
mirsella commentedon Apr 27, 2026
made a quick plugin with codex to auto retry (doesn't error less, just auto retry with some cooldown (1s, then 2sec, 3sec etc if continue to error).
retry-server-errors.ts
hubertlepicki commentedon Apr 27, 2026
So I am getting these errors as well a bit randomly on 5.4 but consistently and always on GPT-5.5. Every prompt I send just fails, while Codex works no problem.
This is also only happening on my employer's Enterprise (EU) OpenAI account, and on my other account I see no such problem at all.
What I found so far is that, for whatever reason, OpenAI is validaging "originator" and "User-Agent" headers on one of the accounts, and refusing to serve OpenCode, while serving Codex requests properly.
I have tested the requests manually, they consistently fail with gpt-5.5 and "opencode" originator/User-Agent, but succeed if I spoof it to be "codex_cli_rs" (for User-Agent it's a longer string).
These headers (User-Agent and originator) do not appear to be configurable within OpenCode, bue even if they were, I do not know if we're safe overriding it.
I do not see a configuration option in the account I have access to to disable/enable it, but maybe someone knows how to disable that header checking so I can keep using OpenCode at work that would be great...
Salloxy commentedon Apr 30, 2026
Was anyone able to solve this?
spark4862 commentedon Jun 2, 2026
Opened #30323 rebased on current
devwith broader OpenAI/Codex stream error coverage (stream_read_error, overload, rate limit), includingparseStreamError,retryable(), andfromError(Error.message)paths plus regression tests. Would appreciate a 👍/review if this matches what you are seeing — especially for Codex gpt-5.x unattended runs.lyjjl commentedon Jun 26, 2026
Environment: OpenCode CLI 1.17.11 on Linux, using the OpenAI provider with gpt-5.5.
环境:Linux 、 OpenCode CLI 1.17.11、 OpenAI provider、gpt-5.5。
I noticed that this issue may be related to having too many MCP servers enabled.
我注意到这个问题可能和启用了过多的 MCP server 有关。
Some MCP servers register a large number of tools, which may exceed certain OpenAI-side limits or trigger unstable behavior (not sure).
某些 MCP server 会注册大量工具,这可能会超过 OpenAI 侧的某些限制,或触发不稳定行为 (不确定)。
In my case, the error seemed to happen when the model was about to use tools.
就我而言,错误似乎是在模型准备调用工具时发生的。
I am not sure yet whether the same issue also exists in Codex CLI.
我目前还不确定 Codex CLI 是否也存在同类问题。
After I used the
/mcpscommand to disable some unnecessary MCP servers, especially the ones registering many tools, it started working normally again.我使用
/mcps命令禁用了一些不必要的 MCP server(尤其是会注册大量工具的 MCP server) 之后,它就恢复正常了。If you are seeing similar errors, it may be worth trying to disable unnecessary MCP servers and reduce the total number of registered tools.
如果你遇到了类似的错误,可以尝试禁用不必要的 MCP server,减少已注册工具的总数量。
github-actions commentedon Aug 26, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.