feat(offload): add cache epoch task snapshots#447
Conversation
|
Thank you for submitting this PR and participating in Tencent Rhino-bird Open-source Training Program! |
YOMXXX
left a comment
There was a problem hiding this comment.
I cannot approve this as-is.
The append-only MMD change removes the existing cleanup/replacement guarantees without adding a bounded stale-context policy:
injectMmdIntoMessages()no longer removes_mmdContextMessageentries when MMD injection is not ready, or when the active MMD cannot be read. The current main branch clears those messages and resetslastMmdInjectedTokensin that path, which prevents stale task context from remaining in the prompt after the active task boundary is gone or not settled.- The active MMD path now appends another marked user message instead of replacing the previous active message.
after_tool_callpreviously updated the single active message in place; this PR can accumulate multiple task snapshot/delta messages inevent.messages/historyMessageswhile those messages are intentionally skipped by compression. That creates an unbounded prompt-growth path and can keep obsolete task context visible to the model. - The new tests only cover pure helpers. They do not cover the regression cases above: injection-ready false after a previous MMD message exists, active file disappears/read returns null, repeated MMD changes across tool-loop updates, or the token count staying bounded.
Please keep the old cleanup/replacement invariant, or add an explicit bounded append-only policy with tests proving stale MMD messages are removed and prompt-visible MMD context cannot grow without limit.
|
Addressed in 4e2734f. The MMD path now restores the existing bounded lifecycle invariant:
Added regression coverage for injection becoming unavailable, unreadable active MMD content, and repeated MMD updates retaining exactly one active prompt message. Validation:
|
Description | 描述
本 PR 从 #410 中拆分,仅聚焦 cache epoch / task snapshot 辅助逻辑。
主要改动:
_mmdContextMessage。不包含以下内容:
tdai_offload_readRelated Issue | 关联 Issue
Related to #120
从 #410 拆分,按评审意见收敛为独立的 cache epoch / task snapshot PR。
Change Type | 修改类型
Self-test Checklist | 自测清单
验证命令:
npm.cmd testnpm.cmd run build:pluginnode --check dist\index.mjsgit diff --check验证结果:
dist/index.mjs语法检查通过。Additional Notes | 其他说明
该 PR 与 #375 独立,评审范围限定在 cache epoch 与 task snapshot 辅助逻辑本身,不包含工具结果卸载/读取或 recall mode 相关改动。