Skip to content

fix(openai): preserve explicit prompt cache controls - #176

Open
sernote wants to merge 1 commit into
Continuum-AI-Corp:mainfrom
sernote:codex/openai-controls
Open

sernote wants to merge 1 commit into
Continuum-AI-Corp:mainfrom
sernote:codex/openai-controls

Conversation

@sernote

@sernote sernote commented Oct 26, 2026 •

Copy link
Copy Markdown

Orca-Code-Review — push 1

Severity Count
P0 0
P1 0
P2 0
P3 0

✅ no blocking findings

OpenAI-compatible requests silently lost prompt_cache_key and prompt_cache_options during request validation, before reaching LiteLLM. Explicit cache mode and request TTL therefore never reached the selected provider.

Declare the optional key and typed options in the request schema. Preserve supplied members without inserting defaults; reject invalid mode/TTL values. This covers blocking and streaming Chat Completions. prompt_cache_retention is outside this change.

Validation: 831 tests passed in the offline Python 3.12 suite. Regressions exercise the HTTP route, schema, Orca adapter, real LiteLLM Router and OpenAI SDK through HTTP MockTransport. Independent review ran 43 targeted tests, including additional invalid-input and serialized-payload checks. Ruff and git diff --check passed. No live provider cache hit or savings claim.

Discovered during a repository audit using audit-prompt-caching, then independently reproduced and reviewed.

@orcacode-review orcacode-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐳 OrcaCode Review

✅ No findings — nothing to flag in this PR. Great work!

OrcaCode Review — Route Smarter. Ship Safer. Spend Less.
Engine-reported: 179 calls · 4.6M tokens · 92% cached

❤️ Share · Install OrcaCode Review

Free on GitHub — the review runs on your own OrcaRouter key. If it helped, a shout-out goes a long way.

Share: X · Reddit · LinkedIn
Follow: X · Discord · LinkedIn · OrcaRouter

@sernote
sernote marked this pull request as ready for review October 26, 2026 20:53

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant