Repository navigation
feat: /acp-rule command — human entry point for recorded acp_rule rules (#1251) - #1259
Conversation
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1259Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1259.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Full review complete (per PR规范, reviewed on the rebased head ① Issue direction (#1251)The issue asks for the missing human entry point to the persistent-rules feature ("现在看不到模型到底记录了啥指令"). This PR addresses the root gap — the feature was only reachable by the model — by reusing the established ② Regression audit (existing behaviors on the touched paths)
③ Code review — key contracts verified
④ Test validityThe 11 new tests have teeth: they drive the real command handler against a real HTTP fake proxy and assert the exact forwarded ⑤ Diff cleanliness8 files, +260/−12, single linear commit on the current master tip ( Evidence
One-line summary: 本 PR 为持久指令功能补齐了人侧入口(pi/omp 的 (Merge stays yours — I don't merge PRs.) |
Closes #1251
What
acp_rule(persistent principle-level reminders) was only reachable by the model. Humans had no way to see what instructions the model had actually recorded ("现在看不到模型到底记录了啥指令"). This adds/acp-rule— the human entry point — mirroring the established/acp-cacheseam (#1146):src/agent/pi.ts, so both launcher and native lanes are covered by one registration): bare/acp-rulelists every recorded rule verbatim (identical output to theacp_ruletool's list);/acp-rule <text>records one directly, as if the model had called it.sendMessage(customType: "bili-acp-rule") with anotifyfallback for hosts without it — and the proxy strips the wrapped message from model context by content signature (src/acp-panel.ts: new[acp-rule]/[/acp-rule]markers added toisAcpPanelText, whole-message anchored like the cache report). The recorded rules themselves already reach the model every turn viaformatRulesForPromptsystem-prompt injection, so the human-facing echo never duplicates into context.disabledOptionalToolNote) is converted into a friendly enablement hint (compress.rules.enabled: true) instead of echoing the model-facing note.Deliberately not in this PR
removeRule/clearRules) is still open; forwarding{delete}/{clear}today would silently degrade to a list (master'sexecuteRuleignores unknown params), so those subcommands land once feat: acp_rule delete/clear — wire kernel removeRule/clearRules (#1177) #1178 merges.Behavior-change disclosure
Pure additive: one new slash command on pi/omp + two new strip markers. No past behavior changes —
isAcpPanelTextgains recognition of a brand-new marker pair that no existing content can contain; all pre-existing strip/wire/config behavior is untouched.Pre-flight (rebased head)
npm run typecheck— cleannpm test— 2456 pass / 3 fail; the 3 failures are intests/claude-native.test.ts(spawned-fake-claude e2e/watchdog tests) and were verified to fail identically on clean master in this sandbox (environment-dependent, unrelated to this change)npm run build— successTests added: 4 command-behavior tests in
tests/plugin-agent.test.ts(list forwarding, record forwarding with trimmed args, notify fallback, disabled-feature hint) + 7 wrapper/strip tests intests/acp-panel.test.ts(detection, suffix/follow-up rejection, whitespace tolerance, marker-quoting rejection, message + Responses-input stripping).Docs: README en/zh (status section) + CONFIGURATION en/zh (pi/omp launcher bullets, plugin-install summary,
compress.rulessection).