fix(compress): make preemptive acknowledgeRisk a no-op instead of an error - #302
Merged
ranxianglei merged 1 commit intoAug 16, 2026
Conversation
📦 Built Plugin ArtifactBranch: Option A — Install from npm PR tag (recommended)opencode plugin opencode-acp@pr-302 --globalEach push to this PR publishes a new version under the Option B — Install from GitHubopencode plugin "github:ranxianglei/opencode-acp#2026-08-14_fix-acknowledge-risk-301" --globalOption C — Download artifact
tar xzf opencode-acp-pr302.tgz
cp -r package/dist ~/.cache/opencode/packages/opencode-acp@latest/node_modules/opencode-acp/dist
This comment is automatically updated on each push. |
Owner
Author
|
追加第二个修复(同一 issue 的另一半):topic 缺失不再报错。 原行为:entry 无 topic 且无顶层 topic → 硬错误 新行为:topic 完全可选,三级 fallback —— entry.topic → 顶层 topic → 从 summary 首行自动派生(去 markdown 标题符、截断 80 字符),保证 验证:batch-compress 11/11,全量 977/977,tsc 通过。 |
…ring (#301) 'content[0] needs a topic' hard-failed compress calls whose entries had no topic and no top-level fallback — another retry dead-end of the same class as the acknowledgeRisk error. Topics are now optional: an entry without its own topic falls back to the top-level topic, then to one derived from the summary's first line (markdown headings stripped, capped at 80 chars), so search_context still has something useful to match on. - lib/compress/range-utils.ts: drop the topic throw; add deriveFallbackTopic; resolveRanges fills the fallback - lib/compress/types.ts, prompts: topic documented as fully optional - tests: the three throw-cases now assert validity; deriveFallbackTopic unit coverage (heading strip, length cap, empty summary)
ranxianglei
force-pushed
the
2026-08-14_fix-acknowledge-risk-301
branch
from
August 14, 2026 15:31
44e73d1 to
053987c
Compare
ranxianglei
changed the base branch from
master
to
2026-08-14_fix-acknowledge-risk-stable
August 14, 2026 15:32
Owner
Author
6 tasks
Owner
Author
Owner
Author
6 tasks
Owner
Author
ranxianglei
merged commit Aug 16, 2026
e0321cc
into
2026-08-14_fix-acknowledge-risk-stable
5 of 6 checks passed
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.
Fixes #301
问题
模型从质量门拒绝模板学到"重试要加 acknowledgeRisk: true",于是把它带进了所有重试——包括参数校验失败(如缺 topic)这类与质量门无关的错误。校验错误不会置位
qualityGateRetryPending,重试即撞上 preemptive 错误,形成混乱的错误循环。修复
无 pending 拒绝时的
acknowledgeRisk改为 no-op:buildPreemptiveAcknowledgeError变更
lib/compress/range.ts— no-op 语义 + 结果中的 ignore 提示lib/compress/quality-gate/{rejection,index}.ts— 移除 preemptive 错误构造器lib/state/types.ts— 更新qualityGateRetryPending生命周期文档tests/quality-gate-enforcement.test.ts— preemptive 拒绝测试替换为 no-op 覆盖(坏摘要+ack 仍被质量门拒绝;好摘要+ack 成功并带 ignore 提示)验证
tsc --noEmit通过tests/quality-gate-enforcement.test.ts13/13