Repository navigation
test(straiker): deterministic integration audit of the v3 platform relay - #42781
Conversation
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>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
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>
|
bugbot run |
…eck every non-streaming burst spend row Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
bugbot run |
There was a problem hiding this comment.
✅ 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.
TLDR
Problem this solves:
How it solves it:
tests/integration/observabilitycells for the v3 and v1 pathsUser Flow
Tests only, no product behavior changes. A reviewer runs
uv run --no-sync python tests/integration/run.py extensionsand the Straiker cells run with the rest of the observability groupRelevant 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
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@greptileaito 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):
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):
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, optionalpost_call,logging_only, fail-open, v1 webhook,api_versionoverride,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.