fix: Catch httpx.ReadError in the error handling (#2309)

* fix: Catch httpx.ReadError in the error handling

* fix
This commit is contained in:
Xun
2026-04-19 22:30:22 +08:00
committed by GitHub
parent f514e35a36
commit a62ca5dd47
2 changed files with 78 additions and 0 deletions
@@ -160,6 +160,8 @@ class LLMErrorHandlingMiddleware(AgentMiddleware[AgentState]):
"APITimeoutError",
"APIConnectionError",
"InternalServerError",
"ReadError", # httpx.ReadError: connection dropped mid-stream
"RemoteProtocolError", # httpx: server closed connection unexpectedly
}:
return True, "transient"
if status_code in _RETRIABLE_STATUS_CODES: