fix(types): silence pydantic ReadOnly warning on StandardLoggingRoutingDecision - #37949
Merged
mateo-berri merged 1 commit intoAug 22, 2026
Merged
Conversation
Contributor
Greptile SummaryThis PR removes the
Confidence Score: 5/5The PR appears safe to merge, with no actionable correctness, compatibility, or security failures identified. The change preserves the field’s runtime value type and construction behavior while using the repository-supported writable exception to suppress Pydantic’s warning.
|
| Filename | Overview |
|---|---|
| litellm/types/utils.py | Reclassifies one routing-decision field as writable to avoid Pydantic schema warnings; no concrete runtime regression or repository-rule violation was identified. |
Reviews (1): Last reviewed commit: "fix(types): silence pydantic ReadOnly wa..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
yuneng-berri
approved these changes
Aug 22, 2026
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.
TLDR
Drops the
ReadOnlyqualifier fromStandardLoggingRoutingDecision.reasoning_override_min_scoreso importing litellm no longer prints a pydanticUserWarningat startup. Pydantic builds a schema over this TypedDict (it is embedded in the router's pydantic models) and warns on everyReadOnlyitem it meets, so the warning greeted every CLI user beforelite claudeeven started. The sibling fieldtier_litellm_paramsalready made the same trade with the same# writable-okmarker; this follows it.User Flow
Before, every
liteinvocation greets the user with a pydantic warning about litellm's own types before the tool even startsLITELLM_PROXY_URL=http://localhost:33279), the user runslite claudein their terminalpydantic/_internal/_generate_schema.py:1480: UserWarning: Item 'reasoning_override_min_score' on TypedDict class 'StandardLoggingRoutingDecision' is using the ReadOnly qualifier. Pydantic will not protect items from any mutation on dictionary instances.followed by awarnings.warn(source linelitellm: routing Claude Code through proxy at http://localhost:33279line appear, Claude Code starts, and requests flow throughPOST http://localhost:33279/v1/messagesnormallylitecommand and anypython -c "import litellm", reading like something is wrong when nothing isAfter, startup is clean and the only line before Claude Code opens is the routing notice
LITELLM_PROXY_URL=http://localhost:33279), the user runslite claudein their terminallitellm: routing Claude Code through proxy at http://localhost:33279, Claude Code starts, and requests flow throughPOST http://localhost:33279/v1/messagesnormallylitecommands andpython -c "import litellm"start silentlyVerification
python -W always -c "import litellm"on the base branch prints the warning once; with this change it prints nothingtests/test_litellm/router_strategy/test_complexity_router.pypasses (the 14 failures in that file are environment-related and identical on the untouched base)make checkpasses; the type-discipline gate accepts the# writable-ok: <reason>suppression and no other rule fires on the changed line