stacklok / stacklok/mecatl

feat: configure Anthropic prompt-cache TTL in settings.yaml

Open
#811 0 comments 0 reactions 1 assignee View on GitHub

@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_ttl setting to settings.yaml.
  • Accept only 5m and 1h; invalid values should retain the existing warn-and-fall-back behavior.
  • Make 1h the 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_control breakpoint.
  • 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.