Skip to content

feat(offload): add cache epoch task snapshots#447

Open
quan020406 wants to merge 1 commit into
TencentCloud:mainfrom
quan020406:feat/cache-epoch-task-snapshots
Open

feat(offload): add cache epoch task snapshots#447
quan020406 wants to merge 1 commit into
TencentCloud:mainfrom
quan020406:feat/cache-epoch-task-snapshots

Conversation

@quan020406

@quan020406 quan020406 commented Jul 9, 2026

Copy link
Copy Markdown

Description | 描述

本 PR 从 #410 中拆分,仅聚焦 cache epoch / task snapshot 辅助逻辑。

主要改动:

  • 新增纯函数 Cache Epoch 合约:初始化、阈值判断和 epoch 转换。
  • 新增 Task Snapshot/Delta helper,首次记录 compact snapshot,后续变化追加 delta。
  • MMD 更新改为 append-only,不再覆写历史 _mmdContextMessage
  • 完整 Mermaid 内容写入现有 ref 存储,prompt 中保留 hash、文件信息和 ref。
  • 使用完整内容 SHA-256 指纹检测 MMD 变化,并维持累计 MMD token 统计。

不包含以下内容:

  • tdai_offload_read
  • 工具结果卸载/恢复
  • recall mode
  • recall injection placement / injected history cleanup

Related Issue | 关联 Issue

Related to #120

#410 拆分,按评审意见收敛为独立的 cache epoch / task snapshot PR。

Change Type | 修改类型

  • Bug fix | Bug 修复
  • New feature | 新功能
  • Documentation update | 文档更新
  • Code optimization | 代码优化

Self-test Checklist | 自测清单

  • Verified locally | 本地验证通过
  • No existing features affected | 无影响现有功能

验证命令:

  • npm.cmd test
  • npm.cmd run build:plugin
  • node --check dist\index.mjs
  • git diff --check

验证结果:

  • 6 个测试文件、70 个测试通过。
  • 插件构建通过。
  • dist/index.mjs 语法检查通过。
  • diff whitespace 检查通过。

Additional Notes | 其他说明

该 PR 与 #375 独立,评审范围限定在 cache epoch 与 task snapshot 辅助逻辑本身,不包含工具结果卸载/读取或 recall mode 相关改动。

@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Thank you for submitting this PR and participating in Tencent Rhino-bird Open-source Training Program!
We have successfully received your submission. The program is currently in full swing, and we will complete the Code Review for you as soon as possible. Please keep an eye on the status notifications for this PR so you can follow up promptly once the review feedback is provided.
Thanks again for your contribution and open-source spirit! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants