Auto Compact

A3S Code can keep long conversations inside the model's context budget for you. Enable autoCompact and the runtime watches context usage; once it crosses autoCompactThreshold, older turns are compacted into a running summary so the agent stays coherent across many steps without you managing tokens by hand. Continuation handles the other direction: when a single response is truncated by length, the runtime automatically continues generating to assemble the full reply.

Rust
Node.js
Python
Go

Use auto-compaction for long sessions where you want the runtime to manage context pressure for you. autoCompactThreshold / auto_compact_threshold is a fraction of the context window (0.0–1.0, default 0.8) at which compaction kicks in; lower it to compact earlier. Inspect the live session with the SDK's history API. Rust, Node.js, Python, and Go also expose direct recent-memory queries (memoryRecent / memory_recent / MemoryRecent).