feat: configure Anthropic prompt-cache TTL in settings.yaml
Open
@jbeda is already working on this.
Since Aug 27, 2026.
- Dominant language
- Go
- Stars
- 152
- Forks
- 16
- Avg merge
- 14h 48m
- Merged PRs (30d)
- 536
Description
Problem
--anthropic-cache-ttl is currently the only way to select Anthropic prompt-cache retention. Its unset default omits cache_control.ttl, which leaves Anthropic at its 5-minute API default. Operators cannot set this persistently in settings.yaml.
Proposed change
- Add an operator-tier
anthropic_cache_ttlsetting tosettings.yaml. - Accept only
5mand1h; invalid values should retain the existing warn-and-fall-back behavior. - Make
1hthe effective default when neither the setting nor the CLI supplies a value. - Define precedence explicitly: CLI flag should override the operator setting.
- Continue stamping the resolved TTL uniformly on every Anthropic
cache_controlbreakpoint. - Update flag/config/user documentation and tests for precedence, validation, and default wire output.
Scope
Anthropic only; OpenAI/OpenRouter/openaichat cache dialects must remain unchanged.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.