GuidesRunning & maintaining

Pi: "Responses websocket connection limit reached (60 minutes)"

Pi's ChatGPT-plan WebSocket closes after an hour; up to 1.5.2 that failed a streaming turn. Pi 1.6.0 retries on a fresh connection: run pi update.

November 20, 2026The Everpod team
The short answer

Signed in with a ChatGPT plan (the openai-codex provider), Pi talks to OpenAI over a WebSocket, and OpenAI closes any such connection after 60 minutes. Up to Pi 1.5.2, if that hour ran out while a reply was streaming, Pi did not reconnect and the turn failed with this message. Pi 1.6.0 (November 20, 2026) retries the request on a fresh connection and stops reusing a connection once it is 45 minutes old. Update with pi update, then type “continue” to pick the failed turn back up. Nothing is wrong with your account or your usage.

What the message means

Error: Codex error: Responses websocket connection limit reached (60 minutes). Create a new websocket connection to continue.
Copied

The text comes from OpenAI’s server, with the code websocket_connection_limit_reached. With its default transport setting, auto, Pi sends ChatGPT-plan requests over a WebSocket and, within a session, keeps that socket open and reuses it for the next request. The server lets one connection live an hour. It is a limit on the connection, not on your plan: a new connection works at once.

Pi has handled the case where the limit hits before a reply starts since mid-2026: it opens a new socket and tries again (#5973, fixed in June), and it retires a cached socket before it reaches the hour (#6268, fixed in July, at 55 minutes). What was left is the case in issue #12124, reported on 1.5.2: a socket reused just under the cutoff, and a long reply still streaming when the hour ran out. Pi’s collaborator petrroll gave the cause there as “once a response has started streaming, the provider does not reconnect on websocket_connection_limit_reached”, and Pi’s own retry did not count it as an error worth retrying, so the turn simply stopped.

The fix: Pi 1.6.0

The 1.6.0 release notes read “Fixed the OpenAI Codex WebSocket 60-minute connection limit failing the turn when it hit mid-stream, the request is now retried on a fresh connection”. Per the issue, the error is now retryable, the retry “opens a fresh WebSocket and resends the full context”, and “cached sockets are no longer reused after 45 minutes, so a response gets at least 15 minutes before the limit”. Check your version and update:

pi --version
pi update
Copied

pi update works for an install made with Pi’s installer, and for an npm install in a folder you can write to; a Nix install updates with nix profile upgrade pi. The cases where pi update refuses are in installing Pi on Linux. A turn that already failed is not lost: the session holds everything up to the error, so after updating, go back to that session and ask Pi to continue.

The retry is Pi’s agent-level retry, so it depends on retry.enabled being left at its default, true, in Pi’s settings (three attempts by default, retry.maxRetries).

One reply longer than an hour

1.6.0 does not lift the limit. A new connection gets a full hour, but if a single reply on its own runs past 60 minutes, petrroll wrote, it “still fails once retries are exhausted”: every retry starts the same reply over and meets the same end. That is rare; asking for the work in smaller steps keeps any one reply short of the hour.

Pi’s transport setting also accepts sse, which sends requests as ordinary HTTPS streams with no WebSocket, and the limit in this message is a WebSocket connection’s. It is Pi’s own option, set in ~/.pi/agent/settings.json (the default agent directory):

{
  "transport": "sse"
}
Copied

You give up the reused socket that auto keeps for each session, and whether OpenAI puts a time limit of its own on a long HTTPS stream is not documented, so treat it as something to try on a version that cannot be updated, not as the fix.

Codex CLI and the same limit

OpenAI’s Codex CLI hits the same server limit on the same backend, and its code at release 0.170.0 classes websocket_connection_limit_reached as an error to retry on a new connection. If you see a Codex CLI turn cut off instead, it is one of the stream errors in “stream disconnected before completion”. How the two agents compare beyond this is in Pi vs Codex.

Run the Pi coding agent on an always-on developer pod.

A developer pod is a permanent cloud computer (VPS), set up and secured for you, with your pick of Claude Code, Codex, OpenCode, Pi, Hermes and OpenClaw installed. Run more agents at once than your laptop can hold, and keep them working when it’s closed. From $24 a month, built in about ten minutes.