Repository navigation
fix: default prompt falsely claimed compress renumbers refs (#541) - #543
Merged
Merged
Conversation
Contributor
📦 Built Extension ArtifactBranch: Option A — Install from npm PR tag (recommended)pi install npm:billion-context-pi@pr-543Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pi-pr543.tgz
pi install ./packageThis comment is automatically updated on each push. |
This was referenced Sep 25, 2026
Closed
Owner
Author
[bot] 🏷 Review 结论:方向正确、改动最小、验证充分,可以合并(合并操作留给人)。 ① 原 issue(#541)— 独立复核通过
② 回归审查 — 触碰路径的既有行为逐项判定
唯一附带效应(一次性):默认提示词文本变化后,升级后使用默认 prompt 的会话首轮 provider 前缀缓存失效一次——任何 prompt 文本修复的固有代价,可忽略。 ③④⑤ 代码 / 测试 / diff
CI 与本地验证(head
|
This was referenced Sep 25, 2026
Merged
Merged
added 2 commits
September 25, 2026 22:33
The summariesInContext section told the model "Every successful compress renumbers the remaining refs — refs recorded before that compress are stale." The kernel does not renumber: assignRefs copies existing.byRaw/ byRef and skips already-mapped messages (acp-kernel src/refs.ts), new refs are appended after highestUsedIndex, and pruneOrphanRefs keeps refs of block-covered messages resolvable. The claim contradicts the kernel contract (ids/refs never reused) and pushed models toward redundant acp_status lookups after every compress. Replace with "Message refs remain stable across compression within the same session state.", keeping the failure-handling rules (verify via acp_status, no arithmetic offset guessing). Update the byte-identical snapshot fixture in lockstep (tests/surface-config.test.ts pins it). Fixes #541
…omment Same misconception as #541 in a code comment: "a successful compress renumbers refs so old fingerprints are meaningless". assignRefs keeps existing mappings; the loop breaker resets because a successful compress is progress, not because refs moved. Comment-only, no behavior change.
ranxianglei
force-pushed
the
2026-09-25_prompt-ref-stability
branch
from
September 25, 2026 14:34
fd79f4b to
72b57d9
Compare
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.
Closes #541
What
The default
summariesInContextprompt section told the model:That contradicts the kernel contract. Verified against
acp-kernel@0.0.86(pinned):assignRefs(src/refs.ts, dist:61-77) copiesoptions.existing.byRaw/byRefand skips already-mapped messages (if (map.byRaw[message.id]) continue;) — surviving refs keep their numbers across compress.highestUsedIndex + 1(dist:4549-4550) — monotonic, never recycled.pruneOrphanRefs(src/runtime.ts:329-342) even keeps refs of block-covered messages resolvable viablock.directMessageIds/effectiveMessageIds— so "refs recorded before that compress are stale" is false for both surviving and compressed-range refs.Change
src/system-prompt.ts(summariesInContext bullet): replaced with "Message refs remain stable across compression within the same session state." The failure-handling rules (verify viaacp_status, never guess offsets arithmetically, batch ranges in one call) are kept verbatim. The "same session state" qualifier excludes fork/derive/log-replay rebuilds where ref space is legitimately re-derived.tests/fixtures/pi-system-prompt-default.txt: snapshot updated in lockstep;tests/surface-config.test.tspins the prompt to this fixture byte-for-byte, which now encodes the corrected sentence as the regression anchor.src/runtime.tsclearDeadCompressdocstring repeated the same false claim ("a successful compress renumbers refs so old fingerprints are meaningless"); corrected to state the real rationale (loop-breaker reset on progress).Behavior change disclosure (per owner policy)
Model-facing surface change, intended by the fix:
acp_statusafter each compress.acp_status, no arithmetic offset guessing).No runtime code path changed; dead-range validity checks and double-compress rejection are untouched (ref stability does not make an already-compressed range recompressible).
Verification
npm run typecheckgreen;npm run buildgreen.default system prompt is byte-identical to the recorded fixturepasses with the new text.Scope note
Same false wording also exists in acp-kernel's lean prompt pack ("Refs may be renumbered after compression. …") — filed separately against acp-kernel per cross-repo policy.