Files
agent/app/server
kicer 71b83bb523 refactor(增量上下文): 用 archived_cnt 代替 hash 校验
原来每轮算 messages 的 sha256 传给 relay 校验,但裁剪会随轮次推移改写历史
(read_file 等回执换成占位符),导致 hash 必然对不上、每次都 409 回退全量。

改成把「压缩代数」编进 context_id:
  <core_id>:<user>:<session_id>:<archived_cnt>
archived_cnt 是已被压缩掉的行数,压缩时自增 → id 自变 → relay 缓存自然失效。
裁剪只改内容不删行,不改变 id,所以不会打断增量(relay 里保留完本文,模型看到的信息更多)。

core 侧不再算 hash(省掉每轮全量序列化),relay 侧只判缓存存在与否。
2026-11-17 22:13:51 +08:00
..
2026-10-25 15:47:12 +08:00