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

Does compacting tool output lower a coding agents API bill?

说明与用途

在编码代理中压缩工具输出仅能略微降低 API 成本,约 2% 的节省,主要因历史记录已被缓存。

问题

Coding agents resend entire conversation history, including tool outputs, on every turn, causing repeated billing for the same output.

结果

In a July 2026 experiment on DeepSeek V4 Pro, the deterministic compactor achieved only about a 2 % cost saving per session, which was smaller than normal run‑to‑run variation. Prompt caching already made repeated output nearly free, limiting the benefit of compaction.

工作流

  • 1. Agent calls a tool and receives output.
  • 2. Output is appended to conversation history.
  • 3. On next turn, entire history is sent to the model, including previous tool outputs.
  • 4. Compactor plugin intercepts the history, applies policies to keep or summarize outputs.
  • 5. Summarized or trimmed outputs are sent to the model, reducing token count.
  • 6. Model processes the compacted history and returns a response.

证据

Coding agents resend old tool output on every turn, so replacing it with something smaller looks like an obvious saving.

来源

The first compactor summarised any tool output over 2,000 characters. It broke coding agents immediately.

来源

The deterministic arm configuration (JSON) …

来源

On DeepSeek V4 Pro the saving was about 2% per session, smaller than ordinary run‑to‑run variation.

来源

  • 记录日期: 2026-10-08T05:40:50.848Z