Files
new-api/controller
CaIon 801456a061 fix(relay): send a close frame when a Responses WebSocket session ends
When a Responses WebSocket session ended on the server side, for example
because the upstream closed or reset its connection, a request timed out
or failed, or a token was rejected, new-api dropped the client socket
without a close frame, so clients such as Codex reported a connection
reset without a closing handshake.

Every way the session ends now sends a close frame first: 1008 for a
rejected token or a disabled channel, the upstream's own 1000 or 1001
when an idle upstream closes normally, 1011 when a request is cut off or
fails, and 1000 to the upstream when the client closes. Each frame waits
at most one second and never waits for a busy writer. Completed turns
still reuse the connection, and billing is unchanged.

Refs #7642
2026-10-11 17:10:53 +08:00
..
2025-03-15 19:10:12 +08:00
2026-08-01 23:19:01 +08:00