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.
@@ -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
- const totalChars = normalized.reduce((total, length) => total + length, 0);
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
- .sort((left, right) => right.length - left.length || left.index - right.index);
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.375",
3
+ "version": "9.1.376",
4
4
  "description": "BLUN CLI - your own AI agent with a Telegram channel. Get it done. With BLUN.",
5
5
  "license": "MIT",
6
6
  "bin": {