test(router): assert the auto-router max_input_chars kwarg - #36109
Merged
yuneng-berri merged 2 commits intoAug 7, 2026
Conversation
PR #35956 added the max_input_chars passthrough to the AutoRouter constructor but left this mock assertion in tests/router_unit_tests unchanged, so test_init_auto_router_deployment_success has been failing on litellm_internal_staging ever since. The passthrough itself is intentional and its behaviour is already covered by TestAutoRouterMaxInputCharsWiring in tests/test_litellm, so only the stale expected kwargs need updating. Assert the shared constant rather than the literal 2000 so tuning the default does not break this test again.
Contributor
Greptile SummaryThis test-only PR updates the AutoRouter constructor assertion to include the shared default input-character limit.
Confidence Score: 5/5The PR appears safe to merge, with no actionable defects identified. The changed assertion now matches the intentional AutoRouter default passthrough, while separate tests continue to cover both configured and fallback values.
|
| Filename | Overview |
|---|---|
| tests/router_unit_tests/test_router_helper_utils.py | Correctly updates the stale mock assertion using the shared constant without weakening coverage or changing runtime behavior. |
Reviews (1): Last reviewed commit: "test(router): assert the auto-router max..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ryan-crabbe-berri
approved these changes
Aug 7, 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
Problem this solves:
litellm_internal_staginghas been failing since fix(auto-router): stop the embedding model's context window from failing long requests #35956max_input_charsHow it solves it:
2000Relevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
This PR is test-only.
git diff --stat c1fa15132b..HEADtouches exactly one file undertests/, no runtime code, so there is no proxy behavior to curl before and after: the routing behavior the assertion guards is identical on both commitsBefore, on
litellm_internal_stagingatc1fa15132bwith no local changes:with
After, at
495eb7e7f4:To confirm the updated assertion still has teeth rather than just matching whatever the code does, I dropped
max_input_chars=from theAutoRouter(...)call inlitellm/router.pyat495eb7e7f4and reran, and the test went red again:Type
✅ Test
Changes
#35956 gave
AutoRouter.__init__amax_input_charsparameter and started passing it fromRouter.init_auto_router_deployment, which caps how much of a prompt reaches the embedding model. That change was intentional and stays as is. What it missed wastests/router_unit_tests/test_router_helper_utils.py, whoseassert_called_once_withon the constructor still spelled out the old kwarg set, so the test has been red on staging ever since and is unrelated to whatever branch a contributor happens to be onThe passthrough is already covered behaviorally by
TestAutoRouterMaxInputCharsWiringintests/test_litellm/test_router.py, which asserts both that a deployment'sauto_router_max_input_charsreaches the registered AutoRouter and that omitting it falls back to the shared default. Duplicating that here would add no signal, so this PR only brings the stale expectation back in line. It assertsDEFAULT_AUTO_ROUTER_MAX_INPUT_CHARSinstead of hardcoding2000so that tuning the default does not break this test a second timeFinal Attestation