refactor(compaction): 压缩提示消歧义 — removed→summarized + before→after 展示#204
Merged
Conversation
压缩完成的系统提示原文是 "N messages removed, M kept",两个词都误导: - "removed" 像是把消息删掉丢弃了 —— 实际是被 LLM 摘要进 summary(内容 还在,还会 rehydrate 重读文件)。 - "kept" 像是把这些原样留着 —— 实际 kept 是压缩**后**的消息总数,含新 生成的 summary,不是"保留的原文"。 改法: - 协议字段 `CompactionSummary.removed` → `summarized`(加 doc 说明是 condensed 进 summary,非 discarded)。 - 用户文案改成 before→after 转移,和 tokens 那行平行: 旧 "406 messages removed, 11 kept. 222325→11121 tokens (94% freed)" 新 "417→11 messages (406 summarized), 222325→11121 tokens (94% freed)" 一眼看出上下文从 417 条缩到 11 条,无歧义词。 纯命名/文案改动,无行为变化。wire-pin 测试 + 6 个 e2e/单测构造点同步更新。
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
Changes
CompactionSummary.removed→summarized(加 doc:condensed 进 summary,非 discarded)。406 messages removed, 11 kept. 222325→11121 tokens (94% freed)417→11 messages (406 summarized), 222325→11121 tokens (94% freed)loopal-protocol(字段)、loopal-runtime(compaction_run 构造/日志)、loopal-view-state(mutators/conversation_display 渲染)。event_lifecycle_test)+ 6 个 e2e/单测构造点同步更新。Test plan