DerekYRC / DerekYRC/mini-claude-code
S09(Memory):MemoryAgentLoop#afterTurn方法,preCompactSnapShot并不会保存当轮的tool_result相关内容
- Dominant language
- Java
- Stars
- 190
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
```java
public AssistantMessage run(List messages, List preCompactSnapshot) {
AssistantMessage answer = compactingLoop.run(messages);
// 提取记忆要使用压缩前的上下文,避免摘要把用户偏好、反馈等细节抹掉。
memoryManager.afterTurn(preCompactSnapshot);
return answer;
}
```
1. 目前preCompactSnapShot只包括上一轮被压缩后的上下文和本轮的用户提示词(query),本轮`run`方法中涉及到的`tool_result`内容,并没有同步到`preCompactSnapShot`变量上,但是这部分内容应该是记忆提取的一个重要来源。
2. 本轮的`tool_result`内容,是会经过`compact`处理的,所以到下一轮记忆提取的时候,内容可能是不完整的,那这个快照的意义可能就不大了。
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at MemoryAgentLoop#run and the call to memoryManager.afterTurn(preCompactSnapshot). Trace where the snapshot is assembled and where tool_result messages are produced during the current turn. Done means the memory extraction snapshot includes those tool_result contents before compaction, with the relevant existing tests updated or added if the repository identifies them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- ai
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100