fix(openrouter): allow DeepSeek cache-ttl eligibility

This commit is contained in:
Peter Steinberger
2026-04-25 06:38:11 +01:00
parent 29f7a2f441
commit d79b9e0af4
6 changed files with 19 additions and 3 deletions

View File

@@ -123,7 +123,7 @@ Per-agent heartbeat is supported at `agents.list[].heartbeat`.
- Anthropic Claude model refs (`amazon-bedrock/*anthropic.claude*`) support explicit `cacheRetention` pass-through.
- Non-Anthropic Bedrock models are forced to `cacheRetention: "none"` at runtime.
### OpenRouter Anthropic models
### OpenRouter models
For `openrouter/anthropic/*` model refs, OpenClaw injects Anthropic
`cache_control` on system/developer prompt blocks to improve prompt-cache
@@ -131,6 +131,11 @@ reuse only when the request is still targeting a verified OpenRouter route
(`openrouter` on its default endpoint, or any provider/base URL that resolves
to `openrouter.ai`).
For `openrouter/deepseek/*`, `openrouter/moonshot*/*`, and `openrouter/zai/*`
model refs, `contextPruning.mode: "cache-ttl"` is allowed because OpenRouter
handles provider-side prompt caching automatically. OpenClaw does not inject
Anthropic `cache_control` markers into those requests.
If you repoint the model at an arbitrary OpenAI-compatible proxy URL, OpenClaw
stops injecting those OpenRouter-specific Anthropic cache markers.