Conversation
The session close route only woke the auto worker when the close result listed closed episodes, jobs, or scheduled evolution. For an L3 World Model v2 session, closeSession also freezes the pending L3 evidence batches and queues l3_world_model_update jobs, but it does not return them. When the session's episode had already closed earlier (idle timeout or end_topic), closedEpisodeIds was empty and nothing woke the worker. The worker does not poll, so the new L3 jobs stayed queued until an unrelated request happened to wake it. The close route now always schedules the worker, as the token compaction boundary already does after freezing batches. A close with no follow-up work costs one empty drain. A new REST contract test closes an L3 v2 session whose episode had already ended and checks that the worker picks up the frozen L3 job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@origami-chen 麻烦审核一下这个 PR:修复关闭会话后新冻结的 L3 任务不会唤醒 worker 的问题。关闭接口改为每次都唤醒一次 worker,只改了 1 行。细节见 PR 描述。谢谢! |
This branch has not been deployed
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.
任务与行为
/new、会话结束钩子)。scheduledEvolution时,才唤醒自动 worker。closeSession会冻结这个会话的 L3 证据批次,并排队l3_world_model_update任务,但不把它们放进结果。episode 已经提前关掉时,closedEpisodeIds为空,worker 就不会被唤醒。worker 也不做周期轮询,这些 L3 任务要等下一个无关请求唤醒 worker 才会执行,实测等了 2 分 41 秒。修改范围
Memory/src/server/http.ts:关闭会话接口改为无条件调用autoWorker.schedule(),1 行代码加 1 行注释。Memory/tests/contract/memory-rest-service.test.ts:新增用例。L3 v2 会话先用"结束会话"关掉 episode,再经 REST 关闭会话,断言closedEpisodeIds为空、冻结出 1 个 L3 任务,并且 worker 在 1 秒内捡起了它。session-turn-service.ts。验证证据
fix-session-close-wake-worker,起点d101fd58(即当前memmy_1031/v1.2.0),提交29ef0723。提 PR 前已 fetch 并 merge 集成分支(Already up to date)。Error: timed out waiting for condition,等满 1 秒后 L3 任务仍是queued、attempts为 0;修改后通过,连续跑 8 次都通过。原有的关闭用例仍通过。npm run memory:test:106 个测试文件中 104 个通过、1 个跳过(仅在 Windows 上运行的安装器集成测试)、1 个失败;921 个用例中 919 个通过。失败的是l3-world-model.test.ts的 "keeps source IDs in evidence order and caps them at the latest 256…",原因是超时:上限 20 秒,这台机器跑全量时它要 35 秒左右。这个失败和本 PR 无关:d101fd58上,同样条件下跑全量,也是这一条超时(35.4 秒,920 个用例中 918 个通过)。npm run lint、npm run typecheck通过。git diff --check upstream/memmy_1031/v1.2.0...HEAD无输出;交付差异只含上面两个文件。upstream/v1.1.9做过试合并(git merge-tree),没有冲突。已知限制
v1.1.9在切换 v2 会话时会新排工作记忆任务,不带 projectId 时同样不会被唤醒。这条路径不在本 PR 范围内。🤖 Generated with Claude Code