You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug][cache] Keepalive reads cache directives from tool arguments and schema examples #6227
Category A: prompt cache. Reproduced on master dc041dd (bili 0.1.213), Node 24.22.1 on Linux.
Reproduction
Send an Anthropic request with a normal five-minute system cache breakpoint and a tool_use input containing ordinary JSON data such as cache_control: {type: "ephemeral", ttl: "1h"}. The recursive keepalive detector treats that input value as a directive. It chooses one hour and schedules at 3,240 seconds rather than 270 seconds, allowing the real five-minute cache to expire.
A matching value inside input_schema examples also arms keepalive when the request has no real cache breakpoint at all.
Expected correction
Read only supported request and block breakpoint locations: top-level automatic cache_control, tool definitions, system blocks and message content blocks. Treat nested input/schema JSON as data. Preserve one-hour precedence among real breakpoints and implicit five-minute defaults.
Evidence and scope
Four regressions fail and one control passes on unchanged master. All five pass with the fix, including production noteSuccessfulForward with a deterministic scheduler; all 36 existing keepalive tests also pass (41 total). Typecheck passed.
History: #5669 fixes omitted TTL defaults; #6078 handles stale asynchronous ping completion after rearming. Neither limits the recursive detector to real breakpoint locations. Open/closed searches for detectKeepaliveTier, tool cache_control and keepalive schema found no matching correction.
Activity