tests(vcr): instrument Redis target + per-cassette persist log lines#26967
Draft
mateo-berri wants to merge 1 commit intolitellm_internal_stagingfrom
Draft
tests(vcr): instrument Redis target + per-cassette persist log lines#26967mateo-berri wants to merge 1 commit intolitellm_internal_stagingfrom
mateo-berri wants to merge 1 commit intolitellm_internal_stagingfrom
Conversation
…ines
Adds two diagnostic surfaces to the VCR Redis persister so we can verify
from CircleCI logs (a) which Redis instance a worker is actually pointed
at, (b) whether SETs are succeeding, and (c) which tests result in cache
hits vs misses vs no recording at all.
- log_redis_target_banner(): printed once per worker at
pytest_recording_configure time. Reports the resolved URL (password
masked), maxmemory_policy, used_memory(_human/_peak_human),
evicted_keys, and the current count of keys under the
litellm:vcr:cassette: prefix.
- _RedisPersister.{load,save}_cassette: emit one [VCR] log line per
call (hit / miss / persist / persist-failed) tagged for trivial
greppability in CircleCI build logs.
All output is namespaced under the 'litellm.vcr.persister' logger and
prefixed with [VCR] so it's easy to filter (`grep '\[VCR\]'`).
Existing unit tests in tests/llm_translation/test_vcr_redis_persister.py
still pass (16/16).
Co-authored-by: Mateo Wang <mateo-berri@users.noreply.github.com>
|
|
Bojun-Vvibe
added a commit
to Bojun-Vvibe/oss-contributions
that referenced
this pull request
May 1, 2026
- BerriAI/litellm#26969: tool-permission guardrail tightening (merge-after-nits) - BerriAI/litellm#26967: VCR Redis observability (merge-as-is) - google-gemini/gemini-cli#26303: brain/critique role split + iteration (needs-discussion) - google-gemini/gemini-cli#26287: voice transcription cursor-position insert (merge-after-nits) - google-gemini/gemini-cli#26274: ssh:// extension install scheme (merge-as-is)
Base automatically changed from
litellm_vcr-cassette-llm-tests-af37
to
litellm_internal_staging
May 1, 2026 22:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Stacked on top of #26838. We want to be able to answer three questions from a single CircleCI log:
SETcalls succeeding (or silently failing —noevictionwill start refusing writes once memory fills)?Right now the persister logs nothing, so all three of those are guesses.
What
Two diagnostic surfaces, both namespaced under the
litellm.vcr.persisterlogger and prefixed with[VCR]so they're trivially grep-able (grep '\[VCR\]' build.log):log_redis_target_banner()— fires once per worker atpytest_recording_configure. Logs the resolved Redis URL (password masked),maxmemory_policy,used_memory_human,used_memory_peak_human,evicted_keys, and the current count of keys under thelitellm:vcr:cassette:prefix._RedisPersister.{load,save}_cassette— one[VCR]line per call:hit/miss/persist/persist-failed, with key, payload size, and episode count.Sample output
Smoke-tested against the actual CI Redis (
redis-19853.crce262.us-east-1-1.ec2.cloud.redislabs.com:19853):That output already confirms two things worth knowing about the target instance independent of this change:
maxmemory_policy=noeviction— once we hitmaxmemory, everySET(VCR or otherwise) will start failing with OOM. There is nothing automatic that prunes our keys; the only pruning is the per-key 24h TTL set bysave_cassette, and a successfulSETresets that TTL.used_memory_peak_human=1.7G— the instance has filled in the past, almost certainly during a previous llm_translation run.Tests
tests/llm_translation/test_vcr_redis_persister.py(the existing 16 unit tests) still pass.Type
🚄 Infrastructure
✅ Test
Slack Thread