fix(openrouter): restore reliable prompt caching - #1278
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Related GitHub Issue
Closes: #1277
Description
Restores reliable OpenRouter prompt caching for agentic, multi-turn tasks.
session_id, enabling provider sticky routing after the first successful request so later turns return to the endpoint holding the warm cache.prompt_tokens_details.cache_write_tokensinto Zoo's cache-write usage field.Reviewers should pay particular attention to using
metadata.taskIdas the session-affinity key. It is stable across turns in one Zoo task and stays within OpenRouter's documented 256-character limit.Test Procedure
From
src/:Results:
git diff --check: passed.A full TypeScript check was attempted but is currently blocked by unrelated missing existing workspace dependencies used by Bedrock:
@smithy/node-http-handler,http-proxy-agent, andhttps-proxy-agent.Pre-Submission Checklist
Visual Snapshots
Not applicable; no UI changes.
Videos (interaction / animation only)
Not applicable; no interaction or animation changes.
Documentation Updates
Additional Notes
OpenRouter prompt caching itself remains available. The reported behavior was caused by Zoo not supplying the session affinity OpenRouter now recommends for agent workflows, combined with a stale static model allowlist and incomplete cache-write accounting.
Get in Touch
GitHub: @navedmerchant