Expand description
Tool result cache helpers.
Cache-key derivation and opt-in tool list. The actual read/write goes
through crate::internal::storage::db::Database::{get,put}_cached_tool_result,
which keeps the storage contract in one place.
Functionsยง
- cache_
key - Compute the cache key for (
tool_name,input). Uses SHA-256 hex over a canonical JSON encoding. - default_
ttls - Tools allowed to participate in caching, with default TTL. Expanding this list is a config decision; read-only network/tool calls are the prime candidates.
- normalize_
input_ for_ key - Normalize a JSON value so structurally-equivalent inputs produce the same cache key. Objects are key-sorted; arrays keep order. Auth context fields are removed so identical requests from different callers collide intentionally (tool cache is per-input, not per-user).