mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 06:15:51 +00:00
fix: 修复内存溢出问题,compact 时清理持久增长数据结构
- compact 时清理 contentReplacementState(seenIds/replacements) - logError() 使用 shortErrorStack 替代完整 err.stack,减少 GC 压力 - permissionDenials 每次 submitMessage 清空,防止无限增长 - SSE 缓冲区添加 1MB 上限,防止畸形数据无限累积 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,7 @@ import {
|
||||
import { CACHE_PATHS } from './cachePaths.js'
|
||||
import { stripDisplayTags, stripDisplayTagsAllowEmpty } from './displayTags.js'
|
||||
import { isEnvTruthy } from './envUtils.js'
|
||||
import { toError } from './errors.js'
|
||||
import { toError, shortErrorStack } from './errors.js'
|
||||
import { isEssentialTrafficOnly } from './privacyLevel.js'
|
||||
import { jsonParse } from './slowOperations.js'
|
||||
|
||||
@@ -175,7 +175,7 @@ export function logError(error: unknown): void {
|
||||
return
|
||||
}
|
||||
|
||||
const errorStr = err.stack || err.message
|
||||
const errorStr = shortErrorStack(err)
|
||||
|
||||
const errorInfo = {
|
||||
error: errorStr,
|
||||
|
||||
Reference in New Issue
Block a user