fix(llm): use a JSON-serializable per-turn model timeout#803
Merged
Conversation
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
An httpx.Timeout in ModelSettings.extra_args crashes ModelSettings.to_json_dict() (PydanticSerializationError) on the Chat Completions and LiteLLM model paths, which serialize settings for their tracing generation span — failing every model turn on those paths. Pass the timeout as a plain float, which httpx-based clients apply as the read (inactivity) timeout.
devin-ai-integration
Bot
force-pushed
the
devin/1784342490-fix-timeout-serialization
branch
from
July 18, 2026 02:44
cd52e0d to
5b38457
Compare
Contributor
Greptile SummaryThis PR makes the per-turn model timeout JSON-serializable and applies it to model requests. The main changes are:
Confidence Score: 4/5The connection-timeout regression should be fixed before merging.
strix/config/models.py Important Files Changed
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
strix/config/models.py:28
**Connection Timeout Loses Its Cap**
A scalar HTTPX timeout applies to connection establishment as well as reads. With the default 300-second setting, an unreachable provider can now consume up to 300 seconds per connection attempt instead of the previous 30-second cap, and retries can multiply that delay.
Reviews (1): Last reviewed commit: "chore(llm): shorten timeout helper docst..." | Re-trigger Greptile |
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
#802's per-turn timeout put an
httpx.Timeoutobject intoModelSettings.extra_args. The Chat Completions and LiteLLM model paths build their tracing generation span fromModelSettings.to_json_dict()(evaluated even with tracing disabled), and pydantic cannot JSON-serializehttpx.Timeout:This fails every model turn on those paths (only the Responses path, which doesn't serialize settings, was unaffected). Fix: pass the timeout as a plain float —
httpx-based clients apply a scalar as the read (inactivity) timeout, so the stalled-stream protection from #802 is preserved. Added a regression test asserting
to_json_dict()succeeds with the timeout set.Link to Devin session: https://app.devin.ai/sessions/dad023e379e942f287bcf6822463b7a4
Requested by: @0xallam