fix: preserve DCP state across compaction and inject continuation nudge after compress#547
Open
LeXwDeX wants to merge 3 commits into
Open
Conversation
added 3 commits
May 24, 2026 01:47
…ge after compress - Persist lastCompaction and messageIds to disk so restarts preserve DCP state - Make resetOnCompaction inert (opencode /compact preserves all msg_* rows in DB) - Save messageIds immediately after assignMessageRefs in chat transform hook - Inject continuation system-reminder after DCP compress tool execution so model resumes its previous task instead of stopping - Update message-ids test to assert preservation instead of reset after compaction Refs: PR Opencode-DCP#530 (tracycam/fix/compress-summary-limits)
- system.ts: 系统提示词全中文,强化禁止 XML 标签 - compress-range.ts: 范围压缩指令全中文,输出格式改为 Markdown - compress-message.ts: 消息压缩指令全中文 - extensions/tool.ts: 工具扩展提示全中文 - extensions/nudge.ts: 提醒提示全中文 - extensions/system.ts: 系统扩展提示全中文 - turn-nudge.ts: 轮次提醒全中文 - iteration-nudge.ts: 迭代提醒全中文 目的:避免英文术语(如 summary)激活 qwen3.7-max 模型的训练记忆, 减少 <analysis>/<summary> XML 标签幻觉问题。
- Remove verbose comments in inject.ts, state.ts, utils.ts - Clean up test file comments - Keep code concise and maintainable
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
lastCompactionandmessageIdsacross process restartsresetOnCompactioninert — opencode/compactpreserves all msg_* rowsBug Details
Bug 1: State lost on compaction restart
lastCompactionwas never persisted → restart re-triggeredresetOnCompaction→ wiped ALL DCP state.Bug 2: Model stops after DCP compress
injectCompressNudgescleared anchors and returned early, leaving model with no guidance.Test Results
82 pass / 1 fail (pre-existing Bun issue)
Refs: PR #530