tests: openai cache coverage#5086
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. 💤 Files selected but had no reviewable changes (1)
⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
tejas ghatte seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Confidence Score: 4/5The new harness coverage has one contained Responses streaming test issue.
tests/e2e/api/collections/provider-harness.json Important Files Changed
Reviews (1): Last reviewed commit: "tests: openai cache coverage" | Re-trigger Greptile |

Summary
Adds Cross-Cut Round 31 to the provider harness E2E test collection, covering OpenAI prompt caching across the new
gpt-5.6model family (sol, terra, luna) and legacy models (gpt-4o, gpt-4.1, gpt-5, etc.). The suite validates thatprompt_cache_options,prompt_cache_breakpoint, andcache_write_tokensfields are correctly passed through and that cache write/read cycles produce the expected token accounting in both streaming and non-streaming modes.Changes
pcNoncecollection variable (set once in the pre-request script) so that paired[write]and[read]requests within a run share the same cache key prefix, enabling cold-then-warm cache hit verification without cross-run collisions.cachePrefixcollection variable containing a large, stable, deliberately verbose prompt text that meets provider minimum token thresholds for prompt caching eligibility.gpt-5.6new fields, non-streaming: validatesprompt_cache_options(mode + TTL),prompt_cache_breakpoint, andcache_write_tokens> 0 on write, thencached_tokens> 0 on read, across native chat, native responses, drop-in chat, and drop-in responses endpoints for sol, terra, and luna variants.gpt-5.6new fields, streaming: same coverage as 31.1 but over SSE, additionally assertingtext/event-streamcontent-type and that usage appears in the stream.cached_tokensshape (numeric on write, > 0 on read) for gpt-5, gpt-5-mini, gpt-5-nano, and gpt-4.1 across native and drop-in endpoints.[read]request includes a ~1.5 s busy-wait pre-request script to allow OpenAI's cache to propagate before asserting a cache hit.Type of change
Affected areas
How to test
Run the collection via Newman against a live Bifrost instance with valid provider keys:
newman run tests/e2e/api/collections/provider-harness.json \ --env-var baseUrl=http://localhost:8080 \ --env-var openaiKey=sk-... \ --folder "Cross-Cut Round 31: OpenAI Prompt Caching"To also exercise the compat path:
newman run tests/e2e/api/collections/provider-harness.json \ --env-var baseUrl=http://localhost:8080 \ --env-var openaiKey=sk-... \ --env-var compat=true \ --folder "Cross-Cut Round 31: OpenAI Prompt Caching"Expected outcome: all
[write]requests reportcache_write_tokens > 0and all[read]requests reportcached_tokens > 0.Screenshots/Recordings
N/A — no UI changes.
Breaking changes
Related issues
N/A
Security considerations
The
cachePrefixcollection variable contains only static, non-sensitive harness text. No secrets, PII, or auth material is introduced. API keys remain in environment variables and are not committed.Checklist
docs/contributing/README.mdand followed the guidelines