Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

12% of a long agent session's cost is compaction

说明与用途

在两次长时间的代理会话中,12% 的计费成本归因于压缩,但实际份额为 11.8%。主要费用来自摘要后的重建回合,而该回合未单独计费。

问题

Agent sessions that compact incur hidden costs in the rebuild turn after a summary, inflating the bill beyond the visible summary call.

结果

In the two studied sessions, compaction accounted for 9.9% of total billed units, with a median payback of 14 turns; the rebuild turn often carries the majority of the cost, making it essential to monitor after each summary.

工作流

  • Identify compaction rows in the session_message log
  • For each compaction, locate the first subsequent turn
  • Calculate its input token count and cache-read cost
  • Compare this cost to a typical normal turn
  • Determine if the interval exceeds the payback threshold
  • Aggregate results to assess overall impact

证据

Compaction has its own line item. In my logs it's 5.5% of the priced bill. The real number is 11.8%

来源

The compaction row carries its own token counts. The median one reads 169,792 tokens of cache and 4,122 fresh input

来源

If you run an agent long enough to compact, the number to check is not the summary call. It is the first turn after it.

来源

  • 记录日期: 2026-10-24T06:26:15.886Z