Skip to content

Bound OpenAI REST retries and requests - #2583

Open
Danielxu0208 wants to merge 1 commit into
open-compass:mainfrom
Danielxu0208:agent/fix-openai-retry
Open

Bound OpenAI REST retries and requests#2583
Danielxu0208 wants to merge 1 commit into
open-compass:mainfrom
Danielxu0208:agent/fix-openai-retry

Conversation

@Danielxu0208

Copy link
Copy Markdown

Summary

  • make every REST request consume one bounded retry attempt
  • add a configurable per-request timeout for direct and proxied requests
  • stop logging quota-exhausted API keys
  • add mock regressions for persistent 429/500 responses, timeout forwarding, and key redaction

Why

Several continue paths ran before the retry counter incremented. A service that continuously returned a non-200 response could therefore loop forever. Requests also had no timeout, and the insufficient-quota path wrote the full API key to logs.

Validation

  • persistent 429 and 500 responses stop after the configured call count
  • timeout reaches requests.post
  • quota handling still disables invalid keys without exposing their value
  • relevant pre-commit hooks passed
  • modified files compile successfully

@Danielxu0208
Danielxu0208 marked this pull request as ready for review August 6, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants