@aragon-agent/core 0.2.26 → 0.2.27

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.
@@ -292,7 +292,9 @@ export async function runAgentLoop(ctx) {
292
292
  // 3. INSIDE the `while`, not before it. A run that starts under the
293
293
  // threshold and crosses it at turn 12 is the normal case, and it is the
294
294
  // case an `agent_end`-based design cannot serve at all (D-1).
295
- await runCompaction(ctx, { trigger: 'pressure', lastUsage, turnIndex });
295
+ if (await runCompaction(ctx, { trigger: 'pressure', lastUsage, turnIndex })) {
296
+ lastUsage = undefined;
297
+ }
296
298
  if (ctx.signal.aborted)
297
299
  break;
298
300
  // ----- Turn start -----
@@ -351,6 +353,8 @@ export async function runAgentLoop(ctx) {
351
353
  throw err;
352
354
  overflowRecovered = true;
353
355
  const recovered = await runCompaction(ctx, { trigger: 'overflow', lastUsage, turnIndex });
356
+ if (recovered)
357
+ lastUsage = undefined;
354
358
  if (!recovered)
355
359
  throw err;
356
360
  if (ctx.signal.aborted)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aragon-agent/core",
3
- "version": "0.2.26",
3
+ "version": "0.2.27",
4
4
  "description": "AragonAgent core engine — LLM provider adapters, streaming, tool registry/execution, steering, idle watchdog, and an optional isolated-vm sandbox.",
5
5
  "license": "MIT",
6
6
  "author": "AragonAgent contributors",