Liking cljdoc? Tell your friends :D

fractal-engine.cache


agent-scopeclj

(agent-scope session-id)
source

default-ttlclj

Explicit prompt-cache TTL for fractal requests.

Anthropic dropped the implicit ephemeral cache default from 1h to 5m on 2026-03-06. The SDK's 5m marker carries no explicit ttl field, so it inherits whatever the server default is — which means fractal's caching silently went from 1h to 5m on that date, independent of any engine change. A recursive run whose root steps are separated by long leaf fan-outs or child recursion routinely gaps past 5m and loses its whole root-transcript cache between steps.

We pin an explicit 1h ttl so the root transcript survives those gaps. (Leaves never clear Anthropic's 1024-token cache minimum, so this only ever creates cache on the root surface; the leaf marker is a harmless no-op.) No beta header is required for 1h as of 2026 — the ttl in cache_control is sufficient.

Explicit prompt-cache TTL for fractal requests.

Anthropic dropped the *implicit* ephemeral cache default from 1h to 5m on
2026-03-06. The SDK's 5m marker carries no explicit ttl field, so it inherits
whatever the server default is — which means fractal's caching silently went
from 1h to 5m on that date, independent of any engine change. A recursive run
whose root steps are separated by long leaf fan-outs or child recursion
routinely gaps past 5m and loses its whole root-transcript cache between steps.

We pin an explicit 1h ttl so the root transcript survives those gaps. (Leaves
never clear Anthropic's 1024-token cache minimum, so this only ever creates
cache on the root surface; the leaf marker is a harmless no-op.) No beta header
is required for 1h as of 2026 — the ttl in cache_control is sufficient.
sourceraw docstring

leaf-scopeclj

(leaf-scope session-id)
source

normalize-ttlclj

(normalize-ttl ttl)

Coerce a caller-supplied ttl to a valid Anthropic ttl, or default-ttl when absent. Throws on an unrecognized value rather than silently degrading to the server default.

Coerce a caller-supplied ttl to a valid Anthropic ttl, or default-ttl when
absent. Throws on an unrecognized value rather than silently degrading to the
server default.
sourceraw docstring

policy-versionclj

source

provider-scopeclj

(provider-scope session-id purpose)
source

request-cacheclj

(request-cache session-id purpose)
(request-cache session-id purpose ttl)
source

session-cacheclj

(session-cache session-id)
source

sha256-stringclj

(sha256-string s)
source

valid-ttlsclj

TTL strings Anthropic accepts. Anything else falls back to the implicit server default in the SDK marker, so we reject unknown values loudly.

TTL strings Anthropic accepts. Anything else falls back to the implicit
server default in the SDK marker, so we reject unknown values loudly.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close