@archships/dim-plugin-auto-compact
Advanced tools
+2
-2
@@ -102,3 +102,3 @@ //#region src/index.ts | ||
| const environmentText = buildAutoCompactEnvironmentMessage(context.status); | ||
| const plan = planCompaction(payload.messages, payload.cursor, normalized, payload.maxInputTokens, payload.thresholdTokens, environmentText); | ||
| const plan = planCompaction(payload.messages, payload.cursor, normalized, Math.max(0, payload.contextWindow - payload.plannedOutput), payload.thresholdTokens, environmentText); | ||
| if (!plan) { | ||
@@ -662,3 +662,3 @@ const stickyFailure = previous.lastAttempt?.status === "failed" && previous.lastAttempt.reasonCode === "post_summary_over_budget"; | ||
| thresholdTokens: payload.thresholdTokens, | ||
| maxInputTokens: payload.maxInputTokens, | ||
| maxInputTokens: Math.max(0, payload.contextWindow - payload.plannedOutput), | ||
| cursor: payload.cursor, | ||
@@ -665,0 +665,0 @@ startedAt |
+3
-3
| { | ||
| "name": "@archships/dim-plugin-auto-compact", | ||
| "version": "0.0.13", | ||
| "version": "0.0.14", | ||
| "description": "Official auto compaction plugin for dim-agent-sdk.", | ||
@@ -27,4 +27,4 @@ "homepage": "https://dimcode.dev/", | ||
| "devDependencies": { | ||
| "@archships/dim-agent-sdk": "0.0.52", | ||
| "@archships/dim-plugin-api": "0.0.19" | ||
| "@archships/dim-plugin-api": "0.0.20", | ||
| "@archships/dim-agent-sdk": "0.0.53" | ||
| }, | ||
@@ -31,0 +31,0 @@ "scripts": { |
+3
-3
@@ -17,3 +17,4 @@ # @archships/dim-plugin-auto-compact | ||
| - configure SDK core compaction budgeting with `compaction.maxInputTokens` plus `triggerTokens` or `triggerRatio` | ||
| - enable SDK core compaction (`compaction: {}` or an explicit `safetyRatio`) on the agent | ||
| - publish `ModelCapabilities.contextWindow` on the model adapter so the gate can derive `threshold = contextWindow − plannedOutput − contextWindow × safetyRatio` | ||
| - configure `compaction.ownerPluginId: 'auto-compact'` | ||
@@ -42,4 +43,3 @@ - grant model permission to the plugin runtime | ||
| compaction: { | ||
| maxInputTokens: 32_000, | ||
| triggerRatio: 0.8, | ||
| safetyRatio: 0.2, | ||
| ownerPluginId: 'auto-compact', | ||
@@ -46,0 +46,0 @@ }, |
Sorry, the diff of this file is too big to display
122891
0.22%