mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 14:25:51 +00:00
fix: 内存优化 — FileReadTool 100KB 上限、lookups 缓存、microcompact 替换清理
- FileReadTool maxResultSizeChars 从 Infinity 改为 100KB,大文件持久化到磁盘 - Messages.tsx 新增 computeMessageStructureKey 缓存,流式 delta 时跳过 8 个 Map/Set 重建 - microcompact 返回 clearedToolUseIds,query.ts 消费后清理 replacements Map 释放原始字符串 - 更新内存分析报告 Round 5 和 file-operations 文档 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -217,6 +217,10 @@ export type MicrocompactResult = {
|
||||
compactionInfo?: {
|
||||
pendingCacheEdits?: PendingCacheEdits
|
||||
}
|
||||
// Tool use IDs whose content was replaced with the cleared message.
|
||||
// Callers should remove these from contentReplacementState.replacements
|
||||
// to release the original strings from memory.
|
||||
clearedToolUseIds?: string[]
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -528,5 +532,5 @@ function maybeTimeBasedMicrocompact(
|
||||
notifyCacheDeletion(querySource)
|
||||
}
|
||||
|
||||
return { messages: result }
|
||||
return { messages: result, clearedToolUseIds: [...clearSet] }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user