Skip to content

test(straiker): assert a saved api_version v1 with an sk_agt_ key routes to v3 - #44153

Merged
yucheng-berri merged 3 commits into
mainfrom
litellm_straiker_v3_saved_v1_cell_main
Oct 2, 2026
Merged

yucheng-berri merged 3 commits into
mainfrom
litellm_straiker_v3_saved_v1_cell_main

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

How it solves it:

User Flow

Before: a maintainer watching main after the #44011 merge sees the extensions suite red

  1. CircleCI runs integration-extensions on main
  2. test_explicit_api_version_v1_overrides_key_prefix fails: the sink saw a v3 call, the test wanted the v1 webhook

After: the suite describes the shipped behavior and is green

  1. CircleCI runs integration-extensions on main
  2. test_saved_api_version_v1_with_v3_key_routes_to_v3_not_the_v1_webhook passes with the rest of the file

Relevant issues

Follow-up to #44011 and #44106 (merged into the mirror branch, not main)

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Screenshots / Proof of Fix

Test-only change, so the proof is the integration rig from tests/integration/README.md: a real proxy with two workers, real Postgres and Redis, the scripted upstream and a local Straiker sink, no mocks inside litellm

Before (826b21a, main)

  1. main's copy of the file run against a two-worker proxy at main's production code: python -m pytest tests/integration/observability/test_straiker_v3_platform.py::test_explicit_api_version_v1_overrides_key_prefix -q
  2. 1 failed in 25.95s: the saved-v1 guardrail posted to /api/v3/detect, zero v1 webhook calls at the sink

After (2a5ff3d)

  1. python -m pytest tests/integration/observability/test_straiker_v3_platform.py -q (run id 949d1e90b65e4beb8698b4a692b1609c, proxy at 193bd1d, two workers)
  2. 36 passed in 77.50s, then a second run with the same selection 36 passed in 73.21s, identical collected and passed sets, no skips
  3. python tests/integration/run.py extensions tests/integration/observability/test_straiker_v3_platform.py tests/integration/observability/test_guardrail_timeout_all_providers.py: 81 passed in 97.00s
  4. CircleCI integration-extensions on this branch at 193bd1d (pipeline 90756): all 81 Straiker and guardrail-timeout cells green except test_burst_survives_one_worker_kill, which hit psutil.ZombieProcess on the killed worker; b229ca0 fixes that cell and 2a5ff3d only reworded the comment above the renamed cell and the file runs 36 passed in 70.49s through run.py again. CircleCI integration-extensions at b229ca0 (pipeline 90762): all 81 Straiker and guardrail-timeout cells green; the only reds in that job are two unrelated observability cells that also fail on main

Type

✅ Test

Final Attestation

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

Link to Devin session: https://app.devin.ai/sessions/16f17e78d5b6462991838dcfb24e3249
Open in Devin Desktop: https://app.devin.ai/desktop/session/16f17e78d5b6462991838dcfb24e3249?variant=devin
Requested by: @yucheng-berri


Devin Review


Note

Low Risk
Test-only changes to integration assertions and worker discovery; no production code paths modified.

Overview
Aligns Straiker integration tests with shipped routing: a guardrail saved with api_version="v1" but an sk_agt_ key must hit v3 detect, not the v1 webhook.

The old cell expected explicit v1/litellm webhook behavior; it is replaced by test_saved_api_version_v1_with_v3_key_routes_to_v3_not_the_v1_webhook, which covers allow (200 + one v3 call, provider reached, zero v1 sink hits) and block (400 + block message, v3 only, no provider).

Separately hardens the worker-kill chaos test: _uvicorn_workers now uses _is_live_worker to ignore zombie children and tolerate psutil errors while waiting for respawn, avoiding flaky psutil.ZombieProcess after SIGKILL.

Reviewed by Cursor Bugbot for commit 2a5ff3d. Bugbot is set up for automated code reviews on this repo. Configure here.

…tes to v3 (#44106)

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@CLAassistant

CLAassistant commented Oct 2, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ yucheng-berri
❌ devin-ai-integration[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low risk] Test case for API version routing behavior.

The PR appears safe to merge.

Summary

This test-only PR updates the saved-v1 Straiker case to assert v3 routing for an sk_agt_ key, and makes the worker-kill test tolerate zombie children while waiting for a replacement worker.

Reviews (2) · Last reviewed commit: "test(straiker): describe the saved v1 ce..."

Comment thread tests/integration/observability/test_straiker_v3_platform.py

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 2 flags

Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

yucheng-berri and others added 2 commits October 2, 2026 06:47
…after a kill

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2a5ff3d. Configure here.

@yucheng-berri
yucheng-berri merged commit 7be2983 into main Oct 2, 2026
130 of 147 checks passed
@yucheng-berri
yucheng-berri deleted the litellm_straiker_v3_saved_v1_cell_main branch October 2, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants