feat: 记忆注入增加来源标注和统一时间戳 - #123
Merged
Merged
Conversation
- InjectionContext 新增 chatId,注入时标注记忆来源(当前会话 vs 其他会话) - 所有记忆类型统一附带日期标注(fact/state/decision/preference/relation) - decision 类型优先使用 createdAt(决策时间),其他类型优先使用 validAt Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @lishuceo's task in 1m 39s —— View job PR #123 Review: 记忆注入增加来源标注和统一时间戳
✅ ApprovedClean, well-structured change. The refactoring of the annotation logic into a unified What looks good:
Minor observation (not blocking):
Note: I was unable to run the test suite due to tool permission restrictions, but the tests are well-written and the PR description confirms 20/20 passing. |
lishuceo
added a commit
that referenced
this pull request
Apr 8, 2026
- InjectionContext 新增 chatId,注入时标注记忆来源(当前会话 vs 其他会话) - 所有记忆类型统一附带日期标注(fact/state/decision/preference/relation) - decision 类型优先使用 createdAt(决策时间),其他类型优先使用 validAt Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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
createdAt(决策时间),其他类型优先使用validAt背景
用户在私聊中发现 bot 携带了来自其他群聊话题的记忆上下文,虽然记忆系统按 user 维度共享是合理设计,但缺少来源标注会让模型混淆上下文。
改动
src/memory/injector.ts:InjectionContext新增chatId,formatMemories增加来源和日期标注逻辑src/feishu/event-handler.ts: 两处injectMemories调用传入chatIdsrc/memory/__tests__/injector.test.ts: 新增 3 个测试用例覆盖来源标注场景Test plan
🤖 Generated with Claude Code