fix: align system prompt with PI rules - #14
Merged
ranxianglei merged 1 commit intoAug 13, 2026
Conversation
Contributor
Author
Dual-agent review recordTwo independent review agents reviewed the source change and approved the final revision.
Both reviewers explicitly confirmed that this PR introduces no Final local verification:
|
Merged
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
This PR refreshes and replaces #5 on the current monorepo. It aligns the shared OpenCode system prompt with the more mature PI implementation by embedding the complete compression guidance exported by
acp-kernel@0.0.19.The change is prompt-only: it does not modify tool registration, V1/V2 message conversion, state, schemas, or kernel behavior.
What changed
COMPRESS_PHILOSOPHYHOW_TO_COMPRESS_RULESTIER2_DISTILL_RULESTIER3_CONDENSE_RULESbili_compress, including single, batch, and block-boundary examplesbili_decompress, including block and single-message refs, default output modes,inline:true, andfull:truebili_search, including search-before-decompress guidancebili_status, including the supportedscopeandviewmodesacp-kernel@0.0.19, the configured floor and cap are both 50,000 tokens.Known limitation:
compressvsbili_compressacp-kernel@0.0.19uses the generic tool namecompressinHOW_TO_COMPRESS_RULESand in its injected nudge text, while this plugin registers the tool asbili_compress.This PR deliberately:
compresswithbili_compress;Before this change, the mismatch was exposed when the kernel injected a nudge. After this change, the same generic wording also appears in the persistent system prompt because
HOW_TO_COMPRESS_RULESis now embedded there. The model can see the separately documented registered tool name, but it may still attempt to call the unavailablecompressname.A precise OpenCode adapter mapping, if adopted, should be reviewed in a separate follow-up PR after this prompt PR is merged.
Scope
packages/core/src/system-prompt.tspackages/billion-context-opencode/tests/system-prompt.test.tsdevlog/2026-08-13_system-prompt-align/No dependency or lockfile changes are included.
Validation
npm run typecheck— passnpm test— pass, 30/30 (4 new tests)npm run build— passbash scripts/ci/check-pr.sh 2026-08-13_system-prompt-align upstream/master— passgit diff --check— passThe rendered prompt is 15,261 characters (approximately 3,815 tokens using the rough characters/4 estimate; this is not an exact tokenizer count).
Independent review
Two independent review agents approved the final change. Their adversarial review led to two accuracy fixes before approval: protected tool output is excluded from compression but may still be emergency-truncated, and
bili_decompresssupports both block IDs and single-message refs.Risk and rollback
The principal risk is the explicitly unresolved tool-name mismatch above, plus the larger static prompt. Rollback requires reverting only this prompt/test/devlog change; there is no persisted-data or schema migration.