You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Distinct from the empty-source normalization issue: the merge branch takes existing.agentId / existing.appId verbatim, but work memories written before this change never had agent_id / app_id set, so existing.agentId is undefined for exactly the rows that most need provenance backfilled. Writing agentId: undefined also relies on the repository's memory.agentId ?? previous.agentId (repositories.ts:658) to preserve the old null, i.e. the merged row still ends up with no Agent/workspace at all. Net effect: the provenance this PR adds is applied to create only, while merges into legacy rows stay unpinned even though the merge may cross Agents. Consider falling back to the current session when the existing row has no Agent (and keep the guarded-spread style used for conversationId / memoryKey a few lines below so an absent value is omitted rather than assigned as undefined).
The comment states the intent is to retain original provenance on merges, but for rows persisted before this change existing.info.source is often absent, so the new provenance is dropped entirely for the merge branch (while create gets source). Consider falling back to the current session's source when the existing row has none, otherwise these older work memories stay permanently unattributed.
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
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.
工作记忆创建时遗漏了所属会话的来源,导致记忆管理页显示“未知”,按 Agent 筛选也无法找到对应记录。本次将 Session 传入工作记忆持久化流程,新建时保存
agentId、info.source和工作区appId,使列表、详情及 Agent 筛选能够识别来源。跨 Agent 合并已有工作记忆时,保留原记录的来源和会话信息,避免被最后更新它的 Agent 覆盖。本次仅修复新记录写入,不批量回填历史无来源记录,不新增数据库字段或修改公开接口。
关联问题:Bug644。
验证:
claude-code、claude、open-code、deepseek-harness别名。检查来源字段、管理页来源、详情和对应 Agent 筛选,并确认其他 Agent 筛选不误收录。npm run lint、npm run typecheck和交付差异检查通过;打包检查:127 项通过、1 项跳过。验证边界:
v1.2.7,其基线提交与此前的1.2.7相同;测试包沿用该分支源码声明的桌面版本1.2.4。包内 Memory buildId 已与源码核对一致,DMG 完整性校验为 VALID。测试包 SHA256:
981b62df476b47aa0ff64de81b5a637ed51d59d4b5bc363346eb232b503fdd82。