Перейти к содержимому

[How Coding Agents Work][10] Compaction and Token Budgeting

DesignDecode Ken

0:00 / 0:00

[How Coding Agents Work][10] Compaction and Token Budgeting

5 просмотров · 13 дн. назад
DesignDecode Ken
194 подписчика
5 просмотров · 13 дн. назад
How Coding Agents Work · Module 10 of 29: Compaction and Token Budgeting Part II — The Six Layers Context layer. What happens when a conversation outgrows the window. Local and server-side compaction, token and image budgets, which invariants are guaranteed to survive a summary, and how the agent is told how much room it has left. After this module you can design a compaction policy with explicit survival guarantees, and give the model honest feedback about its own budget. Lessons in this module: 1. Detecting the wall: token accounting, usable-window percentages, and the five distinct auto-compact triggers 2. Three implementations, one goal: local summarization, server-side compaction, and a token-budget reset that skips summarizing entirely 3. The summarization prompt, and framing the summary as a handoff to a successor 4. What survives: recent user turns under a fixed token budget, the summary itself, and re-injected initial context 5. Dual history: why the pre-compaction transcript is preserved for the reviewer even after the model's copy is replaced 6. Placement matters: keeping the summary as the last history item on mid-turn compaction 7. Telling the model its own budget: context-remaining and new-context-window tools Prerequisites: modules 1, 9. About the course: Built from the OpenAI Codex harness at commit 8d01cd42fa.