Skip to content

fix(compress): make preemptive acknowledgeRisk a no-op instead of an error [stable] - #303

Open
ranxianglei wants to merge 1 commit into
masterfrom
2026-08-14_fix-acknowledge-risk-stable
Open

fix(compress): make preemptive acknowledgeRisk a no-op instead of an error [stable]#303
ranxianglei wants to merge 1 commit into
masterfrom
2026-08-14_fix-acknowledge-risk-stable

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Stable/minimal split of PR #302 — contains only the core #301 fix (acknowledgeRisk). Merge this first; the topic-fallback commit stays in #302 for a follow-up merge.

问题

⚙ compress [acknowledgeRisk=true, dangerous=true]
content[0] needs a topic — provide content[0].topic or the top-level topic
⚙ compress [acknowledgeRisk=true, dangerous=true, topic=xxx]
Parameter "acknowledgeRisk": true was provided, but no quality gate rejection is pending.

模型从质量门拒绝模板学到"重试要加 acknowledgeRisk: true",于是把它带进了所有重试——包括参数校验失败这类与质量门无关的错误。校验错误不会置位 qualityGateRetryPending,重试即撞上 preemptive 错误,形成错误循环。

修复

无 pending 拒绝时的 acknowledgeRisk 改为 no-op:质量检查照常运行(质量门保护不变),成功结果附带提示教模型正确用法。删除 buildPreemptiveAcknowledgeError

验证

  • tsc --noEmit 通过
  • tests/quality-gate-enforcement.test.ts 13/13
  • 全量 975/975 通过(基于最新 master 8a2bee3

…error (#301)

The model routinely carries acknowledgeRisk:true over from non-quality
errors (e.g. argument validation failures like a missing topic), because
the quality-gate rejection template teaches 'add acknowledgeRisk: true to
retry'. The old preemptive guard hard-failed those calls with
'no quality gate rejection is pending', producing a confusing error loop
(issue #301).

Now: acknowledgeRisk without a pending rejection is ignored — quality
checks still run, and the result carries a note teaching correct usage.
Only a real quality-gate rejection arms the bypass, so the gate's
protection is unchanged.

- lib/compress/range.ts: no-op semantics + ignore note in result
- lib/compress/quality-gate: remove buildPreemptiveAcknowledgeError
- lib/state/types.ts: update qualityGateRetryPending lifecycle doc
- tests: replace preemptive-rejection test with no-op coverage (bad
  summary + ack still rejected by quality; good summary + ack succeeds
  with ignore note)
@github-actions

Copy link
Copy Markdown

📦 Built Plugin Artifact

Branch: 2026-08-14_fix-acknowledge-risk-stable (4bcd207)

Option A — Install from npm PR tag (recommended)

opencode plugin opencode-acp@pr-303 --global

Each push to this PR publishes a new version under the pr-303 npm tag.

Option B — Install from GitHub

opencode plugin "github:ranxianglei/opencode-acp#2026-08-14_fix-acknowledge-risk-stable" --global

Option C — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf opencode-acp-pr303.tgz
cp -r package/dist ~/.cache/opencode/packages/opencode-acp@latest/node_modules/opencode-acp/dist
  1. Restart opencode to pick up changes.

This comment is automatically updated on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

发版改走 release PR #304(v1.14.17,包含本 PR 与 #302 的全部 commit)。#304 合并后本 PR 可直接关闭(superseded)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

更正:本 PR 不被 #304 superseded。请先合本 PR,再合 #302(其 base 已指向 master),最后合 #304(仅发版文件)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

最终顺序确认:先合 #305(stable 发版,不含 #301 修复)→ 再合本 PR → 再合 #302#301 修复随下个版本发布。

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.

1 participant