Repository navigation
fix(openai): forward Responses background_options (lts/1.108.x) - #53993
Conversation
background_options was filtered out of /v1/responses requests, so a background completion window silently fell back to the default Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
[Medium impact] The PR appears safe to merge, with the previous finding fixed and no new actionable issues found
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
bugbot run |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 70688d8. Configure here.
Handwritten 1-3 sentence description
LTS twin of #53991. OpenAI's Responses API takes background options such as a completion window for background runs, and the gateway silently removed them, so this passes them through to OpenAI unchanged on the 1.108 line.
Details
Link to Devin session: https://app.devin.ai/sessions/26d0518689f14b8fa0acd3f0254acea6
Open in Devin Desktop: https://app.devin.ai/desktop/session/26d0518689f14b8fa0acd3f0254acea6?variant=devin
Requested by: @mateo-berri
TLDR
Problem this solves:
background_optionson /v1/responses was dropped before reaching OpenAIHow it solves it:
background_options(completion_window,continuation_id) to the Responses optional paramsAdaptations from main:
Screenshots / Proof of Fix
Live before and after on this line, both legs on the same config against the real provider. The main twin's proof is on #53991
One worker without Redis or a database on both legs, since the change only adds a request field and reads no shared state
Before (7276136, merge base with lts/1.108.x)
Invalid completion_window
curl -s localhost:4611/v1/responses -H "Authorization: Bearer sk-1234" -H "content-type: application/json" -d '{"model":"gpt-5-mini","input":"say hi","background":true,"background_options":{"completion_window":"bogus"}}'(HTTP status plus the status, background and error fields shown)Valid completion_window
"completion_window":"soonest"No background_options
background_optionsAfter (b022a7c, later commits change only the test file)
Invalid completion_window
Valid completion_window
"completion_window":"soonest"against port 4612No background_options
background_optionsagainst port 4612Focused tests: tests/unit/responses/test_responses_utils.py 51 passed
Type
🐛 Bug Fix
Caveats (if any)
Medium
2hand8hwindows were rejected by OpenAI for the QA models on main, onlysoonestwas seen succeedingcontinuation_idwas not exercised live, only in the unit testLow
@azure/msal-node6.0.1 in vscode-extension/package-lock.json (GHSA-xcx6-jx8p-x3h5), a lockfile this PR does not touch. The check is not required on this line and main cleared it in build(deps): bump @azure/msal-node to 7.x in vscode-extension to clear osv-scan #50198Note
Low Risk
Adds a forwarded optional request field and types with a focused unit test; no auth or data-path changes.
Overview
Fixes silent dropping of
background_optionson/v1/responsesrequests so LiteLLM forwards OpenAI’s background-run settings to the provider.Adds a
ResponsesAPIBackgroundOptionstype (completion_window:soonest|2h|8h,continuation_id) and registersbackground_optionsonResponsesAPIOptionalRequestParams, which is the allowlist used when building the outbound Responses request.A unit test asserts that
backgroundplusbackground_optionssurvive optional-param filtering and mapping for OpenAI, while unrelated keys are stripped.Reviewed by Cursor Bugbot for commit 70688d8. Bugbot is set up for automated code reviews on this repo. Configure here.