fix(ai): default Anthropic cache retention to 5m - #820
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cacheRetention: "long", model configuration, orPI_CACHE_RETENTION=longWhy
Direct Anthropic requests currently opt into
ttl: "1h"by default even though Anthropic's own default is five minutes. One-hour cache writes cost more and should be an explicit choice rather than Senpi's implicit default.RED -> GREEN
{ type: "ephemeral" }but received{ type: "ephemeral", ttl: "1h" }resolvePromptCacheTtlSeconds()expected 300 but received 3600Verification
npm run build --workspace packages/ainpm run test --workspace packages/ai- 196 files passed, 1,872 tests passednpm run checknode scripts/check-pr-changelog.mjs --base origin/main --labels ""ttlttl; explicit long: 3600 seconds/ttl: "1h"Evidence
Local QA receipts are retained under:
local-ignore/qa-evidence/20260811-anthropic-default-5m/The real CLI request capture is under:
local-ignore/qa-evidence/20260812-anthropic-cache-default/Cleanup
Summary by cubic
Defaulted direct Anthropic prompt caching to 5 minutes to match Anthropic’s default and lower costs; 1-hour retention is now opt-in.
coding-agentkeepalive now reports a 300s TTL by default.Bug Fixes
ttlby default, sending{ type: "ephemeral" }instead ofttl: "1h".resolvePromptCacheTtlSeconds()now returns 300s for Anthropic’s default; precedence stays provider-specific.coding-agentkeepalive and tests now expect 300s; docs and changelogs inpackages/aiandpackages/coding-agentupdated.Migration
PI_CACHE_RETENTION=long,cacheRetention: "long", or configure it on the model.Written for commit cc10b74. Summary will update on new commits.