Skip to content

chore(ci): sync main into internal staging - #36288

Merged
yuneng-berri merged 19 commits into
litellm_internal_stagingfrom
litellm_sync_main_into_internal_staging
Aug 8, 2026
Merged

chore(ci): sync main into internal staging#36288
yuneng-berri merged 19 commits into
litellm_internal_stagingfrom
litellm_sync_main_into_internal_staging

Conversation

@yuneng-berri

Copy link
Copy Markdown
Collaborator

TLDR

Problem this solves:

How it solves it:

  • Back-merges current main into internal staging
  • Reconciles model readiness without adding a second propagation wait

User Flow

Before: a maintainer promoting internal staging is blocked by a branch conflict

  1. They open chore(ci): promote internal staging to main #36286
  2. GitHub reports conflicts and disables the merge action

After: the same promotion can proceed with main included in staging's ancestry

  1. They open chore(ci): promote internal staging to main #36286 after this sync merges
  2. GitHub recognizes the synchronized ancestry and allows the promotion to proceed

Relevant issues

Unblocks #36286

Carries #35020 into internal staging, replacing the unmerged staging counterpart #35012

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests
  • My PR passes all CI/CD checks
  • My PR's scope is as isolated as possible
  • I have received a Greptile Confidence Score of at least 4/5

Screenshots / Proof of Fix

No screenshots apply to this branch-ancestry repair

At commit 09323fcc4a, the merge parents are current internal staging 4d9defd573 and current main 714fff696a

Validation completed at 09323fcc4a:

make pre-commit
0 errors, 0 warnings, 0 notes
tests/e2e raw HTTP client check passed

Type

Infrastructure

Changes

This back-merges current main into litellm_internal_staging, making the current main head part of staging's ancestry

The E2E harness conflict keeps #35020's 40-second first-listing deadline and per-request timeout. Staging's newer propagation barrier remains responsible for replica convergence, while the older continuous polling window is disabled to avoid waiting twice

QA runbook

  • ProxyClient.create_model - model creation keeps the bounded readiness check and waits once for replica propagation
    • Start a multi-replica proxy with STORE_MODEL_IN_DB=True and a reachable database
    • Create a real deployment through /model/new and immediately invoke it through /chat/completions
    • Expect the model creation to return after the configured propagation budget and the invocation to return 200
    • Break model reload and expect model creation to fail near the 40-second first-listing deadline
    • Sanity check: the readiness poll and replica barrier run sequentially without duplicating the propagation wait

Final Attestation

  • The tests check the right things, including edge cases, and regressions in the respective real-world use cases are not possible after this PR

yuneng-berri and others added 19 commits July 21, 2026 19:03
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
_await_model_servable used poll_timeout (120s), the spend/log read-back
budget. A stuck model reload therefore stalled every suite that creates a
deployment for two minutes before failing

Give create_model a fixed harness middle ground: model_servable_timeout=40s,
polled every 2s, with each /v1/models call capped at 5s and clamped to the
remaining deadline so one slow GET cannot overrun the wait. Happy path still
returns on the first listing. Not derived from proxy general_settings or env

Transport.get accepts an optional per-call timeout for that clamp. Unit tests
cover the deadline arithmetic and clamp without a live proxy

(cherry picked from commit c082a0e)
create_model returned after the first /v1/models hit that listed the model,
so chat could still land on a cold gateway worker (numWorkers>1 / peer pod)
and 400 Invalid model name. Require continuous listing for the product
default add_deployment interval (30s) after first sight so every worker has
synced from the DB; first listing still bounded at 40s

(cherry picked from commit 7d1ee2f)
Keep the create_model DB-sync wait in the harness; the pure-function unit
file is not needed for this PR

(cherry picked from commit 8920465)
When less than one full poll interval remained in the first-listing budget,
the pre-sleep check returned NotServable without another /v1/models call.
Sleep only min(interval, time left) so a model that becomes listable in the
last seconds of the timeout still gets a clamped final poll

(cherry picked from commit 8439195)
A poll may start with remaining budget and still return after started+timeout
if the transport overruns its clamp. Recheck the first-listing deadline after
the response so a late listing does not open the continuous DB-sync phase

(cherry picked from commit 7ff2bcb)
…ble_timeout

test(e2e): bound the post-/model/new servable wait at 40s
* fix(mcp): resolve call_tool by registry without requiring tool map

Multi-worker reloads put MCP servers in the registry from the DB but do
not re-run tools/list on every process. Gating call_tool on
tool_name_to_mcp_server_name_mapping made cold workers 500 with Tool not
found after another worker had already listed the tool. Treat a registry
match on server id/name/alias as enough; upstream rejects unknown tools

* test(e2e): poll MCP register, tools/list, and tools/call across multi-worker lag

Stage multi-worker gateways only load MCP servers and tool maps on the
process that handled the request. Poll until the server is listed, the
tool appears on tools/list, and tools/call is not a cold-worker 500 so
key-access and Datadog MCP e2e stop racing the LB

* Revert "fix(mcp): resolve call_tool by registry without requiring tool map"

This reverts commit 8b56e51.

* test(e2e): tighten MCP multi-worker lag classifier

Only retry tools/call on gateway shapes Tool <name> not found and
server_not_found, not any 500 that mentions tool/server not found, so
upstream failures are not retried until the poll deadline

* test(e2e): drop unit file for MCP lag classifier

The live await_call_tool polls already cover multi-worker lag; a separate
string-match unit module is not worth keeping

(cherry picked from commit c274cf3)
test(e2e): poll MCP tools across multi-worker lag (#35047)
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
chore(ci): promote internal staging to main
@codecov

codecov Bot commented Aug 8, 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 marked this pull request as ready for review August 8, 2026 18:14
@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reconciles the E2E model-readiness logic while back-merging main into internal staging.

  • Adds a bounded, deadline-aware poll for newly created models to appear on the data plane.
  • Preserves the separate propagation barrier used for multi-replica convergence.
  • Adds per-call GET timeout overrides throughout the shared E2E transport abstraction.

Confidence Score: 5/5

The PR appears safe to merge, with the readiness deadline and transport timeout propagated consistently through all reachable E2E paths.

The changed polling path preserves first-listing validation and the write-relative replica propagation barrier, while every reachable transport implementation supports the new timeout argument.

Important Files Changed

Filename Overview
tests/e2e/proxy_client.py Introduces typed model-servability outcomes and bounded polling before the existing propagation barrier; no actionable changed-code defect was established.
tests/e2e/transport.py Adds an optional GET timeout override consistently across the protocol, split transport, concrete transport, and underlying HTTP call.

Reviews (1): Last reviewed commit: "chore(ci): sync main into internal stagi..." | Re-trigger Greptile

@yuneng-berri
yuneng-berri merged commit b0fd3e1 into litellm_internal_staging Aug 8, 2026
77 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_sync_main_into_internal_staging branch August 8, 2026 18:25
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.

4 participants