Repository navigation
perf: align nudge/system prompts with pi-side direct-action discipline - #439
ranxianglei wants to merge 1 commit into
Conversation
Listed compression candidates are validated against the real range executor at nudge construction, so the prompt no longer steers the model into a speculative acp_status pre-check turn before compressing. acp_status stays available as an optional diagnostic/refresh path and is mandated only for failure recovery (re-issue compress in the same turn using only reported refs). - context-limit-nudge CANDIDATE_GUIDANCE: validated-at-build-time wording - system prompt: candidate bullet de-hedged, failure-recovery bullet added, MULTI-TIER 'call acp_status first' paragraph removed - compress-range CANDIDATE GUIDANCE tail: post-failure recovery instead of 'use acp_status when stale' - regression tests pin new wording / absence of old hedging - multi-turn injectCompressNudges regression test per AGENTS.md 5.7.1 (shared SessionState, side-effect assertions, preserveRecentMessages: 20) Closes #436
📦 Built Plugin ArtifactBranch: Option A — Install from npm PR tag (recommended)opencode plugin opencode-acp@pr-439 --globalEach push to this PR publishes a new version under the Option B — Install from GitHubopencode plugin "github:ranxianglei/opencode-acp#2026-09-18_nudge-prompt-align-bcp" --globalOption C — Download artifact
tar xzf opencode-acp-pr439.tgz
cp -r package/dist ~/.cache/opencode/packages/opencode-acp@latest/node_modules/opencode-acp/dist
This comment is automatically updated on each push. |
PR #439 verification — code confirmed, CI green, ready for human merge. Treated this as already-completed work (per the What the change does (prompt-only; no logic/state/tool changes):
Files: Independent verification I ran:
Two things to note before merge:
Bottom line: code is correct and tightly scoped, premise verified, CI fully green. Ready for a human to merge (rebase-then-merge recommended); the merge itself stays human-only per policy. 中文摘要:核对已完成的 PR #439(纯提示词改动——让模型直接压缩"构建时已用真实执行器校验过"的候选、不再先调 acp_status,失败才在同轮兜底重试)。逐条验证了 diff 与描述一致、核心前提成立( |
Problem (#436)
With
compress.candidatesenabled, the standing prompt and nudge guidance steered the model into a speculativeacp_statuspre-check turn before compressing listed candidates ("useacp_statusfor a fresh view", "callacp_statusfirst"). On local models each extra round trip costs 15–23s, and the extra small turn amplifies prompt-prefix invalidation after compression.Fix (prompt-only, aligned with billion-context-pi / acp-kernel discipline)
The candidate list is already authoritative:
planCompressionCandidates()validates every MICRO/EPISODE entry against the real range executor at nudge construction (lib/messages/inject/candidates.ts) — stronger than the kernel's static suggestions. So only the prompt discipline needed porting; no arming/state/tool changes were required.lib/prompts/context-limit-nudge.ts— CANDIDATE_GUIDANCE now states candidates were validated when the nudge was built; compress directly; on a stale-ID failure runacp_statusonce and re-issue using only reported refs.lib/prompts/system.ts— candidate bullet de-hedged ("do not callacp_statusfirst"); new failure-recovery bullet (no arithmetic range adjustment; re-issue same turn, batched); removed the MULTI-TIER "callacp_statusfirst" paragraph.lib/prompts/compress-range.ts— CANDIDATE GUIDANCE tail: direct-action + post-failure recovery instead of "useacp_statuswhen stale".acp_statusremains fully functional as an optional refresh/diagnostic path; stale-plan and structure-version validation untouched.Not ported verbatim from the kernel: "every successful compress renumbers the remaining refs" — opencode-acp refs are sticky per raw message ID (
lib/message-ids.ts), so the recovery line is phrased generically.Tests
tests/prompts.test.ts,tests/nudge-text.test.ts: constant-level regression tests pinning the new wording and asserting removal of the old hedging phrases.tests/compression-candidates.test.ts: multi-turninjectCompressNudgesregression test per AGENTS.md §5.7.1 — two consecutive calls sharing one SessionState, assertsshouldInjectThisTurn+lastPerMessageNudgeTokens/lastNudgeShownTokensside effects after each turn, rendered nudge carries the new guidance without old hedging, production-stylepreserveRecentMessages: 20. Verified to exercise the max-limit anchor path (guidance renders only once usage crossesmaxContextLimit).Verification: typecheck ✓, prettier (changed files) ✓, build ✓, full suite 1270/1272 — both failures are environmental in the review sandbox (read-only
/tmp;tests/soft-block.test.ts:14mkdir andtests/inactive-block-decompress.test.ts:206hardcoded/tmptoFile path) and reproduce independently of this diff.No version bump (release branches only).
Closes #436