Skip to content

feat: acp_rule persistent model reminders (compress.rules) #749

Description

@ranxianglei

来源: ranxianglei/billion-context-pi#433https://github.com/ranxianglei/billion-context-pi/issues/433)实现三仓 acp_rule 时,billion-context 侧适配需独立跟踪。

What

Opt-in support for the acp_rule tool from acp-kernel (acp-kernel#283): persistent principle-level reminders the model records, which survive every compression fold.

Design (owner constraints: keep it simple, no system-prompt changes)

  • Config: rules?: boolean scalar on CompressSettings — three-level cascade (global → provider → model, deepest wins), off by default. Maps to kernel Config.rules = { enabled }.
  • Tool injection: when enabled, injected on the anthropic / openai / responses native-tool wires next to absorb (same gate: enabled && injectTool). Plugin clients get it in the manifest unconditionally (like absorb) with a per-session execution gate via effectiveRulesConfig.
  • Semantics: ordinary tool, add-by-default — pass rule to record a short reminder, omit the argument to list recorded rules. No remove/clear actions (stale-rule management = edit the session state file). Kernel validation errors are returned verbatim (no FAILED marker): empty / too long / duplicate / limit reached.
  • Protection: hard protection comes free from the kernel (ALWAYS_PROTECTED_TOOLS includes acp_rule) — the call and its result survive every fold. No client-side logic needed.
  • No system-prompt changes: usage guidance lives entirely in the kernel's tool description.
  • Persistence: rules live in CompressionState.rules; added to the persist.ts mergeState whitelist so they survive restarts.
  • Limits: kernel defaults 50 rules × 300 chars each.

Dependency

Requires acp-kernel #283 merged + published (wire schemas + state API). Until then this branch validates against a local dist overlay; the acp-kernel pin bump follows as a follow-up commit before merge.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions