fix(memo,context): 重构 memo 语义去重为批量决策,优化 tool content 摘要保留头尾关键信息#610
Closed
fix(memo,context): 重构 memo 语义去重为批量决策,优化 tool content 摘要保留头尾关键信息#610
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ResolveDecision)升级为批量决策(ExtractDecisions),一次 LLM 调用同时完成提取与去重Changes
memo 语义去重批量化
DecisionExtractor接口,接收existing []ExtractionCandidate由 LLM 在一次调用中输出create/update/skip决策数组LLMExtractor同时实现DecisionExtractor(主路径)和DecisionResolver(降级路径),提示词注入既有记忆快照AutoExtractor.extractAndStore优先走DecisionExtractor批量路径,旧Extractor实现退化为逐条ResolveDecision以保持兼容ExtractRecentMessages配置字段TestLLMExtractorExtractDecisionsIncludesExistingCandidates等测试context micro compact 头尾保留
sanitizeProjectedToolContent/sanitizeRawToolContent改为调用sanitizeToolExcerpt,保留头部 300 字符 + 尾部 300 字符BuildMemoExtractionMessagesForModel排除RoleSystem消息,避免框架注入的元数据污染记忆提取Test plan
go test ./internal/memo/...通过go test ./internal/context/...通过go test ./internal/app/...通过go build ./...通过