Skip to content

test(model_management): cover actor edges and wildcard models - #41769

Merged
yuneng-berri merged 2 commits into
mainfrom
litellm_model-actor-edges
Sep 21, 2026
Merged

yuneng-berri merged 2 commits into
mainfrom
litellm_model-actor-edges

Conversation

@yuneng-berri

@yuneng-berri yuneng-berri commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Model-management regression coverage missed actor and persistence edges
  • Wildcard coverage missed an unknown provider fallback

How it solves it:

  • Exercises the POST and PATCH routes through FastAPI
  • Checks persisted update values and wildcard provider names

User Flow

Before: proxy behavior is unchanged, but these management paths can regress without the new test coverage

  1. A proxy admin sends POST /model/new, POST /model/update, or PATCH /model/{id}/update
  2. The proxy applies its existing actor, storage, persistence, and config-model rules
  3. A later code change can break one of those paths without this test suite detecting it

After: the same requests retain their existing behavior and tests fail when those rules regress

  1. A proxy admin sends the same management request
  2. The proxy applies the same existing rule
  3. The focused tests fail when a matching behavior mutation is introduced

Relevant issues

Affected release

Linear ticket

Resolves LIT-8087

Pre-Submission checklist

  • I have added meaningful tests
  • The handful of test files covering my change pass locally
  • My PR passes all required CI/CD checks
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of 5/5 before requesting a maintainer review

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

Before (db37977)

Coverage mutations

  1. The original mapped Python file passed when each planned actor, storage, update, config-model, and route-binding behavior was mutated
  2. The original dashboard test passed with wildcard construction hard-coded to openai/*

After (e29f69f)

Coverage mutations

  1. uv run pytest tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py -q reports 268 passed
  2. vitest reports 7 passed with no type errors for handle_add_model_submit.test.tsx
  3. Each new behavior test fails under its matching functional mutation
  4. Removing the unknown-provider lowercase fallback returns Petals/* and fails the expected petals/* assertion

Type

Test

Caveats (if any)

Final Attestation

  • The tests check the right things, including edge cases, and prevent regressions in these management paths

@yuneng-berri
yuneng-berri requested a review from a team September 18, 2026 05:41
@greptile-apps

greptile-apps Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The test-only changes appear safe to merge and add meaningful coverage without weakening existing assertions

Summary

This PR adds focused regression coverage for model-management authorization, database requirements, partial-update persistence, config-only model rejection, FastAPI route bindings, and dashboard wildcard model construction

  • Exercises direct endpoint functions and their registered HTTP routes
  • Verifies changed and preserved model fields at the persistence boundary
  • Covers mapped wildcard providers and the lowercase fallback for an unknown mapping

Reviews (1) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..."

@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yuneng-berri
yuneng-berri merged commit 6b254b6 into main Sep 21, 2026
88 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_model-actor-edges branch September 21, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants