Repository navigation
Conversation
Greptile SummaryThis PR fixes
Confidence Score: 5/5Safe to merge — the change is additive and backward-compatible, existing messages-based cache lookups are unaffected. The fix is isolated to prompt extraction and kwargs filtering, no existing code paths are altered in a breaking way, and 14 new mock-only tests cover the key branches. No files require special attention.
|
| Filename | Overview |
|---|---|
| litellm/caching/redis_semantic_cache.py | Adds _get_prompt_from_kwargs, _collect_responses_input_text, and _coerce_response_input_value helpers so that all four cache paths (sync/async set/get) can extract prompts from Responses API input in addition to chat messages. Logic is well-structured with correct early-exit and fallback handling. |
| litellm/caching/caching.py | Sync get_cache now passes a filtered copy of kwargs (only messages, input, and a fresh empty metadata) to backend caches, then copies semantic-similarity back to the original metadata via _update_metadata_from_cache_lookup_kwargs. Also removes the long-standing dead kwargs.get("messages", []) no-op statement from the async path. |
| tests/test_litellm/caching/test_redis_semantic_cache.py | Adds 14 new unit tests covering sync/async set+get with string input, structured Responses input flattening, model object coercion, blank-text fallback, missing-input no-op, dynamic cache wrapper passthrough, and sensitive-kwarg filtering. All tests use mocks and make no real network calls. |
| docker/Dockerfile.non_root | Adds libatomic to both build stages; unrelated to the caching fix. |
| tests/test_litellm/interactions/test_openapi_compliance.py | Adds budget_exceeded to the expected status enum and updates the date comment; unrelated to the caching fix. |
Reviews (2): Last reviewed commit: "fix: filter sensitive cache lookup kwarg..." | Re-trigger Greptile
|
🤖 litellm-agent: This PR is currently BLOCKED from merge. Score: 4/5 ❌ Why blocked:
Details: Score docked for: 1 unresolved reviewer concern (greptile). Fix the issues above and push an update — the bot will re-review automatically.
|
916a81f to
1f290e5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Thanks @shivamrawat1 for switching the base branch 🙇 |
732fe96 to
61abfa8
Compare
PR overviewMedium: Async semantic cache logs request credentialsThis PR filters the synchronous Redis semantic cache lookup kwargs, but the async lookup path still forwards the full request dictionary into the Redis semantic cache. That leaves async callers able to get request credentials written to semantic-cache verbose logs. Security review
Risk: 5/10 |
|
@balcsida could you add a screenshot or short video showing that this change works as expected? It really helps reviewers verify the fix quickly. Thanks! |
|
I'm not sure what would be the best was to demonstrate this, but here you go: https://asciinema.org/a/KEiuqzzoUE7NlUkK |
|
@mateo-berri why? :( |
Relevant issues
Fixes #28272
Replaces #28274, which was closed after its previous staging base branch was deleted. This PR recreates the same Redis semantic cache fix on the current
shin_agent_oss_staging_05_22_2026base.Linear ticket
N/A
Pre-Submission checklist
Screenshots / Proof of Fix
Before this change, RedisSemanticCache only extracted prompts from messages. Responses API calls pass input instead, so RedisVL store/check were skipped and the RediSearch index stayed empty.
Validation run locally:
I did not run the full
make test-unitsuite locally.Type
Bug Fix
Test
Changes