[Fix] CICD 26/02/26 - #22151
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryCI/CD fix PR that addresses type-checking issues, resolves merge conflicts, fixes test flakiness, and tightens guardrail exception matching.
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| litellm/litellm_core_utils/realtime_streaming.py | Added cast import and applied type casts to satisfy type checkers — no behavioral change. |
| litellm/llms/bedrock/chat/invoke_transformations/amazon_qwen3_transformation.py | Same changes as qwen2: consolidated duplicate Usage import and used setattr for usage assignment for type safety. |
| litellm/proxy/_types.py | Reformatted imports (line-per-import style), removed unused MCPAuth import, and cleaned up backslash-continuation imports. No behavioral changes. |
| litellm/proxy/common_utils/http_parsing_utils.py | Fixed potential AttributeError by safely checking request.state existence before accessing _cached_headers. Defensive null-check prevents crashes when request objects lack a state attribute. |
| litellm/proxy/db/db_spend_update_writer.py | Tightened payload_copy parameter type from dict to SpendLogsPayload, matching the actual type returned by get_logging_payload(). |
| litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/policy_templates/sg_mas_transparency_explainability.yaml | Narrowed guardrail exception phrases: "explainability" → "improve/add explainability", "audit trail" → "with/add audit trail". This tightens when the guardrail is bypassed, which may cause false positives on legitimate queries. |
| tests/pass_through_unit_tests/test_pass_through_unit_tests.py | Added state attribute to MockRequest to match the defensive null-check added to _safe_get_request_headers. |
| ui/litellm-dashboard/src/components/ToolPolicies.tsx | Resolved git merge conflict markers that were previously committed to main — removed <<<<<<< cursor/..., =======, and >>>>>>> main markers and duplicate code blocks. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Incoming Request] --> B{request.state exists?}
B -->|Yes| C{_cached_headers set?}
B -->|No| D[Read request.headers]
C -->|Yes| E[Return cached headers]
C -->|No| D
D --> F{state is not None?}
F -->|Yes| G[Cache headers on state]
F -->|No| H[Skip caching]
G --> I[Return headers]
H --> I
J[Guardrail Check] --> K{Exception substring in text?}
K -->|Old: 'explainability' matched| L[Skip block - broad match]
K -->|New: 'improve explainability' only| M[Narrower match - may block more]
M --> N{Identifier + block word found?}
N -->|Yes| O[Block request]
N -->|No| P[Allow request]
Last reviewed commit: f8e0b37
| - "improve explainability" | ||
| - "add explainability" | ||
| - "interpretability" | ||
| - "model card" | ||
| - "audit trail" | ||
| - "with audit trail" | ||
| - "add audit trail" |
There was a problem hiding this comment.
Narrowed exceptions may cause false positives
The exception matching uses substring matching (if exception in text_lower). Previously, "explainability" would match any text containing that word (e.g., "discuss explainability requirements"). Now, only "improve explainability" and "add explainability" will match, so a query like "what are the explainability requirements for this model?" would no longer be exempted and could be incorrectly blocked.
Similarly, "audit trail" previously matched "ensure we have an audit trail", but now only "with audit trail" and "add audit trail" will match—missing phrasings like "ensure audit trail compliance".
Was this intentional tightening? If so, consider adding more exception variants (e.g., "ensure explainability", "require explainability", "maintain audit trail", "ensure audit trail") to avoid blocking legitimate compliance-focused queries.
[Fix] CICD 26/02/26
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Changes