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

@@ -133,6 +133,7 @@ import { getAPIProvider } from './utils/model/providers.js'
import {
createCacheWarningMessage,
getCacheThreshold,
isCacheWarningEnabled,
shouldShowCacheWarning,
} from './utils/cacheWarning.js'
@@ -1256,7 +1257,7 @@ async function* queryLoop(
cache_read_input_tokens: number
}
| undefined
if (usage) {
if (usage && isCacheWarningEnabled()) {
const warningInfo = shouldShowCacheWarning(
usage,
querySource,