feat: surface cached token counts in /status output (openclaw#21248) thanks @vishaltandale00

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: vishaltandale00 <9222298+vishaltandale00@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
Vishal
2026-02-19 22:06:13 -05:00
committed by GitHub
parent db8ffb13f4
commit f1e1cc4ee3
18 changed files with 766 additions and 9 deletions

View File

@@ -44,6 +44,8 @@ type CacheRetentionStreamOptions = Partial<SimpleStreamOptions> & {
*
* Only applies to Anthropic provider (OpenRouter uses openai-completions API
* with hardcoded cache_control, not the cacheRetention stream option).
*
* Defaults to "short" for Anthropic provider when not explicitly configured.
*/
function resolveCacheRetention(
extraParams: Record<string, unknown> | undefined,
@@ -67,7 +69,9 @@ function resolveCacheRetention(
if (legacy === "1h") {
return "long";
}
return undefined;
// Default to "short" for Anthropic when not explicitly configured
return "short";
}
function createStreamFnWithExtraParams(