feat: 添加 cacheWarningEnabled 配置项,支持在 /config 面板关闭缓存率警告

This commit is contained in:
claude-code-best
2026-06-06 10:15:24 +08:00
parent 9947ae75da
commit a972ed795c
4 changed files with 34 additions and 1 deletions

View File

@@ -40,6 +40,14 @@ export function getCacheThreshold(): number {
return settings.cacheThreshold ?? DEFAULT_CACHE_THRESHOLD
}
/**
* 检查缓存警告是否启用。默认 true。
*/
export function isCacheWarningEnabled(): boolean {
const settings = getInitialSettings()
return settings.cacheWarningEnabled ?? true
}
/**
* 计算缓存命中率
* 返回值范围 0-100null 表示无有效数据