fix(providers): disable AsyncOpenAI keep-alive reuse to avoid SSL UNEXPECTED_EOF on idle-reaping gateways - #205
Closed
raymondginger2018-sudo wants to merge 1 commit into
Conversation
…UNEXPECTED_EOF from gateway idle-connection reaping (scnet)
Collaborator
|
Closing for the same reason as the keep-alive half of #198: disabling keep-alive here is hard-coded for every OpenAI-compatible connection (OpenRouter, DeepSeek, Ollama, …), not just the gateway that reaps idle connections, and the custom The shape that would be accepted is a connection-level option — for example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is the remaining, independent half of #198: disable keep-alive connection reuse in
OpenAICompatProvider’sAsyncOpenAIclient so third-party gateways (e.g. scnet) that reap idle connections don’t hand back a dead connection, which surfaces asSSL: UNEXPECTED_EOF_WHILE_READING.The GLM-5.2 catalog entry from #198 was already merged upstream as a standalone commit credited to me (
329e98f0), so this PR contains only the keep-alive fix.Changes
core/providers/openai_compat.py: passhttp_client=httpx.AsyncClient(limits=httpx.Limits(max_keepalive_connections=0))toAsyncOpenAI(+8 lines). New connection per request (~50–100 ms handshake) is negligible for LLM-second-scale calls.Tests
python -m py_compile core/providers/openai_compat.py✓Notes
upstream/main(c0a6a3c); single file, no CLAUDE.md / .gitleaksignore changes.Related: #198