providerSupportsCaching gated on the provider NAME being literally
'anthropic', so an Anthropic-shaped provider registered under a custom
config name (platformai, bedrock, any relay) never set
CacheLastMessage — every turn re-processed the full conversation
history uncached (~120K input tokens and 4-6s TTFT per turn on a
large session).
Add llm.PromptCachingProvider capability interface; AnthropicProvider
declares it; runtime gates providerSupportsCaching and
providerSupportsMidLoopCompaction on the capability first, with the
name check kept as legacy fallback for custom impls.
Claude Fable 5 safety classifiers decline requests with HTTP 200 +
stop_reason=refusal and empty content. The Anthropic stream parser
never read stop_reason, so a refused turn looked like a successful
empty response — the UI showed nothing and the agent appeared hung.
- llm: ChatEvent carries StopReason/StopCategory on EventDone;
StopReasonRefusal constant
- anthropic: parse stop_reason + stop_details.category from
message_delta (streaming) and the message (non-streaming); WARN log
on refusal
- runtime Run + RunTurn: on refusal, retry the turn once on
FallbackModel (refusals are model-specific; Opus-tier has no
bio/cyber classifiers), discarding any partial output; without a
fallback (or if the fallback also refuses) synthesize a visible
'model declined this request' message with the policy category
instead of silent emptiness