mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 13:55:50 +00:00
perf: 优化内存与遥测管理,启用 Vite minify
- 禁用 HISTORY_SNIP feature flag 并新增 proactiveTruncate 防止无 compact_boundary 时内存无限增长 - 跳过未启用 telemetry 时的 OTel 初始化,防止长会话 PerformanceMeasure 堆积 - OTel 导出遇 401/403 自动关闭 reader,防止 handle 泄漏 - Vite 构建启用 minify Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -320,6 +320,16 @@ async function doInitializeTelemetry(): Promise<void> {
|
||||
return
|
||||
}
|
||||
|
||||
// Skip entire OTel initialization when telemetry is not enabled.
|
||||
// Prevents PerformanceMeasure accumulation in long-running sessions.
|
||||
if (!isEnvTruthy(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)) {
|
||||
telemetryInitialized = true
|
||||
logForDebugging(
|
||||
'[3P telemetry] Skipped — CLAUDE_CODE_ENABLE_TELEMETRY not set',
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// Set flag before init to prevent double initialization
|
||||
telemetryInitialized = true
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user