Skip to content

test(straiker): deterministic integration audit of the v3 platform relay - #42781

Merged
yucheng-berri merged 4 commits into
mainfrom
litellm_straiker_v3_audit_tests_main
Sep 23, 2026
Merged

yucheng-berri merged 4 commits into
mainfrom
litellm_straiker_v3_audit_tests_main

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

How it solves it:

  • Adds 34 deterministic tests/integration/observability cells for the v3 and v1 paths
  • Real proxy, Postgres, Redis, two workers; scripted upstream and a local Straiker sink at the edges
  • Covers happy, sad, edge and chaos (sink outage burst, worker kill, proxy restart)

User Flow

Tests only, no product behavior changes. A reviewer runs uv run --no-sync python tests/integration/run.py extensions and the Straiker cells run with the rest of the observability group

Relevant issues

Follow-up to #41880

Affected release

Linear ticket

Resolves LIT-8462

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/test_litellm/<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)

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

Audit run of these cells against the #41880 merge base and head (two-worker rigs, owned Postgres and Redis, run ids 8fea90b1 and 4f0ed28d):

base b41e6c966afb548a337ab0fe02feee1a7847bda3: 7/34 Straiker cells pass (the v1 and management cells the PR left unchanged)
head 5378c7ece25b2378be6f4c9bf2086d93086f5d1d: 34/34 pass, run twice with --seed 4106601 --order-seed 7, identical collected and passed sets, 0 skips

Same file at this branch tip 1a519dc on top of main (run id 3b490d6c), two consecutive full runs after the Greptile and Bugbot fixes (real uvicorn worker as the kill victim, one detect call asserted before the unknown-model error, the v1 block cell asserts its v1 webhook call, every non-streaming burst id checked for one spend row):

$ for i in 1 2; do python -m pytest tests/integration/observability/test_straiker_v3_platform.py -q | tail -1; done
34 passed in 60.57s (0:01:00)
34 passed in 60.04s (0:01:00)

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


Note

Low Risk
Test-only addition with no changes to proxy or guardrail implementation; risk is limited to CI runtime and maintenance of the new integration harness.

Overview
Adds a ~1,090-line integration suite (test_straiker_v3_platform.py) that exercises the Straiker guardrail through a real LiteLLM proxy (two workers, Postgres, Redis) with only the Straiker platform and upstream LLM provider mocked as local HTTP sinks.

The rig wires multiple guardrail profiles (default-on v3 pre_call, optional post_call, logging_only, fail-open, v1 webhook, api_version override, format_hint / routing headers) and 34 deterministic tests assert relayed payloads, block/deny behavior, credential redaction, spend logging, and failure modes (500/401/non-JSON). Chaos cases stop/restart the Straiker sink mid-burst, SIGKILL a uvicorn worker, and restart the proxy to validate blocked-turn memory and recovery.

No production/runtime code changes—coverage only for the v3 platform relay shipped in #41880.

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

34 cells against a real two-worker proxy, Postgres and Redis with a scripted
provider upstream and a local Straiker sink: v3 allow, block, deny, replay and
killswitch verdicts on chat completions, messages, responses and completions
across the OpenAI and Anthropic SDKs and raw httpx, pre_call, post_call and
logging_only modes, header and identity precedence, credential redaction,
sink outages, malformed verdicts, unauthenticated and unknown-model requests,
management endpoints, the unchanged v1 path, and a mixed burst through a sink
outage, a worker kill and a proxy restart

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

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

greptile-apps Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The test-only PR appears safe to merge, with no outstanding correctness, security, or repository-rule violations identified.

Summary

This PR adds a deterministic integration audit for the Straiker v3 platform relay, covering v3 and legacy v1 behavior through a real multi-worker proxy setup. Since the previous review, it:

  • Isolates the v1 blocking test from the default-on v3 guardrail and confirms exactly one v1 call.
  • Extends outage-burst spend-log verification to successful non-streaming Anthropic requests.
  • Retains the fixes for both previously reported test-coverage issues.

Reviews (3) · Last reviewed commit: "test(straiker): assert the v1 webhook ra..."

Comment thread tests/integration/observability/test_straiker_v3_platform.py Outdated
Comment thread tests/integration/observability/test_straiker_v3_platform.py
@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…re the unknown-model error

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

Copy link
Copy Markdown
Contributor Author

@greptileai

@yucheng-berri

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.

Stale Bugbot comment from a previous run.

Comment thread tests/integration/observability/test_straiker_v3_platform.py
Comment thread tests/integration/observability/test_straiker_v3_platform.py
…eck every non-streaming burst spend row

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

Copy link
Copy Markdown
Contributor Author

@greptileai

@yucheng-berri

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 1a519dc. Configure here.

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