Skip to content

fix(anthropic): preserve supported cache control policies - #177

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

sernote wants to merge 1 commit into
Continuum-AI-Corp:mainfrom
sernote:codex/anthropic-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

The native Messages translator dropped supported cache_control markers and TTLs from system, content and tool blocks. A client's cache policy therefore disappeared before LiteLLM could build the provider request.

Preserve those markers, including marked multipart tool results. Translate a top-level automatic policy into an explicit marker on the last cacheable block of the existing translated payload, checking TTL conflicts and available breakpoint slots. Keep unmarked-request behavior and the established block grouping unchanged. No Anthropic-only top-level parameter is sent to other providers.

Validation: 842 tests passed in the offline Python 3.12 suite, with independent review and additional transformation/HTTP controls. Tests exercise the native HTTP route, schema, real Orca adapter and LiteLLM transformations, plus a separate real OpenAI Router/SDK transport path. The prepared environment lacks LiteLLM's optional mcp dependency needed for full dispatch with custom tools; those tool payloads are checked through the actual provider transformers. Ruff and git diff --check passed. No live provider cache hits or savings measured.

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: 158 calls · 7M 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 21:41

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