@caupulican/pi-adaptative 0.80.40 → 0.80.42

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.
@@ -205,7 +205,7 @@ export class AgentSession {
205
205
  const contextWindow = this.model?.contextWindow ?? 0;
206
206
  if (settings.enabled && contextWindow > 0 && !this.isCompacting) {
207
207
  const contextTokens = this._estimateCurrentContextTokens(authoritativeMessages);
208
- if (shouldCompact(contextTokens, contextWindow, settings)) {
208
+ if (shouldCompact(contextTokens, contextWindow, settings, this.model?.autoCompactionTriggerTokens)) {
209
209
  const latestBefore = getLatestCompactionEntry(this.sessionManager.getBranch())?.id;
210
210
  await this._runAutoCompaction("threshold", false);
211
211
  const latestAfter = getLatestCompactionEntry(this.sessionManager.getBranch())?.id;
@@ -1711,7 +1711,7 @@ export class AgentSession {
1711
1711
  }
1712
1712
  }
1713
1713
  }
1714
- if (shouldCompact(contextTokens, contextWindow, settings)) {
1714
+ if (shouldCompact(contextTokens, contextWindow, settings, this.model?.autoCompactionTriggerTokens)) {
1715
1715
  return await this._runAutoCompaction("threshold", false);
1716
1716
  }
1717
1717
  return false;