fix(memory-plugin): harden recall and capture state - #3917
Open
yuanqingz wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
@t0saki @huangruiteng 麻烦有空帮忙 review 一下这个 PR,重点包括 Codex memory plugin 的 auto-recall/compressor fail-closed 行为,以及 Stop、PreCompact、SessionStart 之间的跨进程 capture state 一致性与崩溃恢复。 83/83 focused tests 和上游 API/CLI integration 均已通过。谢谢! |
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
Why
When the relevance compressor failed at runtime, automatic recall previously fell back to injecting weak candidates without a relevance decision. Experience lifecycle metadata was also hidden from the client, so deprecated or archived content could still be injected through compatibility paths.
Separately, detached Stop, PreCompact, and SessionStart hooks could overlap read-modify-write state transitions. A fixed temporary filename and non-transactional clear/save flow made acknowledged batches vulnerable to duplicate capture or stale-state resurrection after a crash.
User impact
Validation
/examples; they do not exercise files changed by this PR.node --checkfor all changed modules andgit diff --checkpassed.Related
The independent server-side memory semantics changes are in #3916. Neither PR contains the other's commit.
中文说明
改动概述
问题背景
此前 relevance compressor 运行失败后,自动召回会退回到未经相关性判断的弱候选,增加无关 memory 注入。客户端也看不到 Experience 的 lifecycle metadata,因此 deprecated 或 archived 内容仍可能通过兼容路径进入上下文。
另一方面,detached Stop、PreCompact 与 SessionStart hook 可能同时执行 read-modify-write。固定临时文件名以及非事务化的 clear/save 流程,使已经被服务端接受的 batch 在进程退出后存在重复 capture 或旧状态复活的风险。
用户影响
验证结果
/examples的既有环境问题,不涉及本 PR 修改的功能。node --check,并通过git diff --check。相关 PR
服务端 memory 语义的独立修复位于 #3916;两个 PR 均不包含对方的提交。