Repository navigation
feat(compress): configurable compression prompts (three-level, risk-gated) - #157
Merged
Merged
Conversation
…ated) Adds `prompts` + `acknowledgePromptsRisk` to CompressSettings (#156): - prompts override object (compressPhilosophy / howToCompressRules / tier2DistillRules / tier3CondenseRules), merged sub-field-wise across global > provider > model levels - overrides are inert until acknowledgePromptsRisk: true at the winning level (kernel rules are load-bearing); one-time warn when ignored - resolved via kernel resolvePrompts (non-string fields silently dropped) - threaded consistently into system prompt, nudge text, and compress loop - docs (EN/zh-CN) + 6 unit tests
Owner
Author
…pts override Regression review findings on #157: - the three builder templates had a lone trailing space where master had an empty line — the default-path system prompt differed by one byte from pre-upgrade output, breaking the prefix-cache anchor. Verified fixed: default-path output of all three builders is now BYTE-IDENTICAL to origin/master (direct string comparison against a snapshot import). - adds tests/e2e-compress-prompts.test.ts: real startServer proxy + mock upstream capturing the wire body. Proves (1) provider+model sub-field merged overrides reach the upstream system message, (2) overrides are inert without acknowledgePromptsRisk (defaults on the wire + warn log), (3) no-config path keeps the kernel default prompt.
ranxianglei
added a commit
that referenced
this pull request
Aug 15, 2026
ranxianglei
added a commit
that referenced
this pull request
Aug 15, 2026
This was referenced Aug 15, 2026
Merged
Merged
This was referenced Oct 7, 2026
Closed
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.
Partially addresses #156 (the custom-prompts suggestion).
What
Adds
compress.prompts+compress.acknowledgePromptsRiskto the existing three-level cascade (global → provider → model):promptsoverrides the kernel prompt text (compressPhilosophy,howToCompressRules,tier2DistillRules,tier3CondenseRules), merged sub-field-wise across levels — a model-levelhowToCompressRulesdoes not discard a provider-levelcompressPhilosophy.resolvePrompts(non-string fields silently dropped; a malformed partial never clobbers a good default).acknowledgePromptsRisk: trueat the winning level. Without it: one-time[compress] prompts override IGNOREDwarning + defaults.renderNudgeText), and the compress loop inforward()— kernel contract: both layers must use the samePrompts.Main use case: non-English / small-model prompt tuning (#156: 2B model spinning in the compress loop).
Stacking
Stacked on #153 (admin follow-up) — merge that first, then retarget this to master.
Verification
npm run typecheckclean;npm test402/402 (6 new unit tests: three-level sub-field merge, risk-gate fallback, non-string drop, end-to-end route cascade).npm run buildclean (2.04 MB).