Retry transient failures while polling OpenAI background responses #4900
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 230 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.326
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #4900"
general
weight: 0.35
jacobbabula
This PR contains:
What is the current behavior? (You can also link to an open issue here)
When the Responses API runs in background mode,
client.responses.retrieve()wraps transport failures as OpenAI SDK exceptions such asAPIConnectionErrorandAPITimeoutError. The polling retry predicate only recognized raw HTTPX exceptions, so a transient failure aborted polling instead of retrying the already-running response.Fixes #4880.
What is the new behavior?
Background polling retries
APIConnectionError(includingAPITimeoutError) with the existing five-attempt/60-second bound. It does not retry status errors such as rate limits. The exhausted path re-raises the original SDK exception, and regression coverage exercises both a successful retry and five-attempt exhaustion under asyncio and Trio.Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No.
Validation after merging current
main:python -m pytest tests/model/providers/test_openai_responses.py -q: 64 passed, 16 skipped (live API and Trio-only variants)--runtrio: 2 passed, 2 asyncio variants skipped, 76 deselectedsrc/inspect_ai/model/_providers/openai_responses.pygit diff --checkpassedAgent review
mainhad moved the CHANGELOG entry into released version 0.3.260, and the PR body still described the superseded shared-classifier implementation; no remaining findings in the touched files