@ai-agent-forge/agent-forge 0.86.1 → 0.86.2

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.
@@ -103,6 +103,14 @@ export class AgentSession {
103
103
  _overflowRecoveryAttempted = false;
104
104
  // biome-ignore lint/correctness/noUnusedPrivateClassMembers: read and written via the agent-session-* submodule facade
105
105
  _overflowTrimStage = 0;
106
+ /**
107
+ * microcompact 冷却(按模型请求计数,0 = 不冷却):relief 落地时置
108
+ * MICROCOMPACT_COOLDOWN_ASSISTANT_RESPONSES,此后每次 assistant message_end
109
+ * (无论 stopReason)减 1、下限 0;user message_start 不复位。冷却期内阈值
110
+ * decide 以 microcompactEnabled:false 关闭便宜缓解。微观经济动机见
111
+ * agent-session-compaction.ts 的常量注释(中部历史改写 × 不稳定前缀缓存)。
112
+ */
113
+ _microcompactCooldown = 0;
106
114
  // Branch summarization state
107
115
  _branchSummaryAbortController = undefined;
108
116
  _branchSummaryPromise = undefined;
@@ -506,6 +514,11 @@ export class AgentSession {
506
514
  this._overflowRecoveryAttempted = false;
507
515
  this._overflowTrimStage = 0;
508
516
  }
517
+ // microcompact 冷却按模型请求计数:每个完成的 assistant 响应(无论
518
+ // stopReason)释放一档,下限 0;冷却期内的阈值 decide 不做便宜缓解。
519
+ if (this._microcompactCooldown > 0) {
520
+ this._microcompactCooldown -= 1;
521
+ }
509
522
  // Reset retry counter immediately on successful assistant response
510
523
  // This prevents accumulation across multiple LLM calls within a turn
511
524
  if (assistantMsg.stopReason !== "error" && this._retryAttempt > 0) {