blun-king-cli 9.1.375 → 9.1.376
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/tool-result-offload-policy.cjs +2 -15
- package/blun.mjs +1 -0
- package/package.json +1 -1
|
@@ -236,26 +236,13 @@ function selectHistoricalToolResultOffloads(textLengths) {
|
|
|
236
236
|
const normalized = textLengths.map((length) => (
|
|
237
237
|
Number.isFinite(length) && length > 0 ? Math.floor(length) : 0
|
|
238
238
|
));
|
|
239
|
-
|
|
240
|
-
if (totalChars <= TOOL_RESULT_HISTORICAL_MAX_CHARS) return [];
|
|
241
|
-
|
|
242
|
-
let projectedChars = totalChars;
|
|
243
|
-
const selected = [];
|
|
244
|
-
const candidates = normalized
|
|
239
|
+
return normalized
|
|
245
240
|
.map((length, index) => ({ index, length }))
|
|
246
241
|
.filter(({ length }) => (
|
|
247
242
|
length >= TOOL_RESULT_HISTORICAL_MIN_ITEM_CHARS
|
|
248
243
|
&& length > TOOL_RESULT_HISTORICAL_REPLACEMENT_BUDGET_CHARS
|
|
249
244
|
))
|
|
250
|
-
.
|
|
251
|
-
|
|
252
|
-
for (const candidate of candidates) {
|
|
253
|
-
if (projectedChars <= TOOL_RESULT_HISTORICAL_MAX_CHARS) break;
|
|
254
|
-
projectedChars -= candidate.length - TOOL_RESULT_HISTORICAL_REPLACEMENT_BUDGET_CHARS;
|
|
255
|
-
selected.push(candidate.index);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
return selected.sort((left, right) => left - right);
|
|
245
|
+
.map(({ index }) => index);
|
|
259
246
|
}
|
|
260
247
|
|
|
261
248
|
module.exports = {
|
package/blun.mjs
CHANGED
|
@@ -262334,6 +262334,7 @@ var init_turn = __esmMin((() => {
|
|
|
262334
262334
|
hooks: {
|
|
262335
262335
|
beforeStep: async ({ signal: stepSignal, stepNumber }) => {
|
|
262336
262336
|
await this.agent.records.flush();
|
|
262337
|
+
await this.agent.toolResultBatchOffload.detect();
|
|
262337
262338
|
this.agent.microCompaction.detect();
|
|
262338
262339
|
await this.agent.userMessageOffload.detect();
|
|
262339
262340
|
await this.agent.assistantMessageOffload.detect();
|