Browse Source

fix(acp): adapt compaction wiring to token meter

Tianyi Cui 2 tháng trước cách đây
mục cha
commit
247526d4ca
2 tập tin đã thay đổi với 12 bổ sung và 5 xóa
  1. 3 0
      examples/acp-agent/composition.md
  2. 9 5
      examples/acp-agent/cordis.yml

+ 3 - 0
examples/acp-agent/composition.md

@@ -27,6 +27,8 @@ flowchart LR
   bundle_agent_core --> spine_sessions["ctx.sessions"]
   bundle_agent_core --> spine_tools["ctx.tools + tool-bash"]
   bundle_agent_core --> spine_loop["ctx.agents + ctx.agentLoop"]
+  plugin_acp_token_meter["token-meter<br/>@deepseek-ai/dsh-token-meter"]
+  cfg --> plugin_acp_token_meter
   plugin_acp_compact_basic["compact-basic<br/>@deepseek-ai/dsh-compact-basic"]
   cfg --> plugin_acp_compact_basic
   plugin_acp_subagent["subagent<br/>@deepseek-ai/dsh-subagent"]
@@ -61,6 +63,7 @@ flowchart LR
 | `approval` | `@deepseek-ai/dsh-user-approval` |
 | `permission` | `@deepseek-ai/dsh-permission` |
 | `acp-agent` | `@deepseek-ai/dsh-acp-demo` |
+| `token-meter` | `@deepseek-ai/dsh-token-meter` |
 | `compact-basic` | `@deepseek-ai/dsh-compact-basic` |
 | `subagent` | `@deepseek-ai/dsh-subagent` |
 | `subagent-spawn` | `@deepseek-ai/dsh-subagent-spawn` |

+ 9 - 5
examples/acp-agent/cordis.yml

@@ -48,16 +48,20 @@
 
       Verify your work by running the code or tests. Keep answers brief and factual.
 
-# Summarize an older range when derived history approaches the context window.
-# This leaf consumes `ctx.llm` and the app's `agent/pre-step` seam.
+# Replay-aware request pressure with one service-wide context window.
+- id: token-meter
+  name: '@deepseek-ai/dsh-token-meter'
+  config:
+    # FIXME: Resolve compaction config per model; this capacity assumes a 256k context window.
+    contextWindow: 256000
+
+# Summarize an older range after measured pressure or a canonical provider overflow.
+# Service-wide policy provides pressure, retention, and one overflow-retry default.
 - id: compact-basic
   name: '@deepseek-ai/dsh-compact-basic'
   config:
-    # FIXME: Resolve compaction config per model; these values assume a 256k context window.
-    contextWindow: 256000
     thresholdRatio: 0.8
     retainTokens: 20480
-    summarizationModel: ''
     maxTokens: 8192
     compactionRetries: 1