mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 21:24:31 +00:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user