Problem
Agents connected through the Central CLI proxy (OpenCode, Codex, Claude Code, Junie) respond very slowly. Many requests fail with HTTP 502 after about 5 minutes. Successful requests take several minutes.
Example of the Central CLI log:
POST 200 277598ms /llm/openai/v1/responses
POST 502 299997ms /llm/openai/v1/responses
x-response-origin: local-proxylevel=ERROR msg="upstream request failed" error="Post \"https://api.jetbrains.ai/llm/openai/v1/responses\": context canceled"
level=WARN msg="request error" agent=opencode route=openai status=502 duration_ms=299998 response_origin=local-proxy resp_body_len=0Cause
A network component between the local machine and api.jetbrains.ai slows down the connection. Typical examples are a corporate proxy, a firewall, a VPN or TLS inspection. Responses from the AI service are streamed, and a component that buffers or inspects the stream delays them.
When no response arrives within the agent's timeout, the agent cancels the request. The Central CLI proxy then returns a 502 to the agent. The 502 is created locally and is not an error of the JetBrains AI service.
What to check in the log
Check these values in the failed requests:
| Value in the log | Meaning | Why it matters |
response_origin=local-proxy or x-response-origin: local-proxy
|
The local Central CLI proxy created the 502. | The JetBrains AI service returned no error. This is not a service outage. |
| resp_body_len=0 | No response came back from api.jetbrains.ai. |
The request did not fail on the server. It did not finish in time. |
context canceled in upstream request failed
|
The agent closed the request, and the proxy cancelled its upstream call. | The agent stopped waiting. A timeout of the proxy itself shows context deadline exceeded instead. |
duration_ms of about 300000
|
The request ran for 5 minutes. | 300000 ms is the default headerTimeout and chunkTimeout of OpenCode, see the OpenCode providers documentation. Other agents have other limits. One repeated value points to an agent timeout. |
Duration of successful (200) requests |
Speed of the upstream when it answers. | Several minutes for a 200 shows that the whole path is slow. |
Resolution
- Test the same setup on another network, for example, a home network or a mobile hotspot without VPN.
- If the requests are fast there, the cause is the company network. The network administrator should check the proxy, firewall, VPN and TLS inspection rules for
api.jetbrains.ai, and any changes on the date the slowness started. - If requests are slow across all networks, escalate to the Central CLI team with the JetBrains Console organization ID and the timestamps of the slow requests.
Comments
0 comments
Please sign in to leave a comment.