Skip to content

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

Merged
yucheng-berri merged 1 commit into
litellm_straiker_v3_review_fixesfrom
litellm_straiker_v3_review_fixes_ci
Oct 2, 2026
Merged

yucheng-berri merged 1 commit into
litellm_straiker_v3_review_fixesfrom
litellm_straiker_v3_review_fixes_ci

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 merging #44011 gets a red extensions suite on the next main run

  1. CircleCI runs integration-extensions on main after the merge
  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 stays green

  1. CircleCI runs integration-extensions on main after the merge
  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

Stacked on #44011, follow-up to #42781

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. Legs are the #44011 merge base (63b6e7f) and the #44011 tip (fcebfa9) that this branch sits on

Before (63b6e7f)

  1. uv run --no-sync python -m pytest tests/integration/observability/test_straiker_v3_platform.py::test_saved_api_version_v1_with_v3_key_routes_to_v3_not_the_v1_webhook -q
  2. FAILED ... 1 failed in 24.21s: the saved-v1 guardrail posted to /api/v1/detect/webhook, zero v3 calls at the sink

After (fcebfa9 plus this commit)

  1. uv run --no-sync python -m pytest tests/integration/observability/test_straiker_v3_platform.py -q (run id ac42505a18e843c3bc37a225e3969aa6)
  2. 36 passed in 78.75s, then a second run with the same selection 36 passed in 66.44s, identical collected and passed sets, no skips

Type

✅ Test

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 change; no production code or runtime behavior is modified.

Overview
Updates the Straiker integration test for the straiker-v3-as-v1 guardrail (sk_agt_ key with saved api_version: v1) so expectations match routing after #44011.

Replaces test_explicit_api_version_v1_overrides_key_prefix, which asserted the v1 webhook (litellm format header), with test_saved_api_version_v1_with_v3_key_routes_to_v3_not_the_v1_webhook. The new test checks allow and block paths: traffic goes to /api/v3/detect (including block verdict and no upstream call), and never to the v1 webhook for that key.

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

…tes to v3

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

@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 test-only change appears safe to merge.

Summary

The PR updates one integration test to assert that a guardrail saved with api_version: v1 and an sk_agt_ key uses the v3 detect endpoint rather than the v1 webhook.

  • It checks both an allowed request and a blocked request, including whether each reaches the provider.

Reviews (1) · Last reviewed commit: "test(straiker): assert a saved api_versi..."

@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!

@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: 1 flag

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

Devin Review

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 eea7cdb. Configure here.

@yucheng-berri
yucheng-berri merged commit dc449ec into litellm_straiker_v3_review_fixes Oct 2, 2026
96 of 98 checks passed
@yucheng-berri
yucheng-berri deleted the litellm_straiker_v3_review_fixes_ci branch October 2, 2026 05:35
yucheng-berri added a commit that referenced this pull request Oct 2, 2026
…tes to v3 (#44153)

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

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

* test(straiker): ignore zombie workers when counting uvicorn children after a kill

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

* test(straiker): describe the saved v1 cell by the v3 route it asserts

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

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: yucheng <yucheng@berri.ai>
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.

1 participant