Skip to content

Automatic context compaction

Demonstrates automatic context compaction for long-running workflows, using a beta tool runner with compaction_control.

  • Upstream notebook: tool_use/automatic-context-compaction.ipynb

What to focus on

  • When to compact (token threshold)
  • How compaction changes message history (summary insertion)
  • Keeping behavior stable across long ticket queues / multi-step loops

Run locally

make test-notebooks NOTEBOOK=tool_use/automatic-context-compaction.ipynb