Does compacting tool output lower a coding agents API bill?
Описание и применение
Сжатие вывода инструментов в кодирующих агентах незначительно снижает стоимость запросов к API, поскольку повторное пересылание истории уже почти бесплатно благодаря кэшированию.
Задача
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