Turn On OpenAI's Server-Side Compaction for Hour-Long Agent Runs

Caps context growth on long agent loops so each turn re-bills a compacted prefix instead of the full transcript; the win scales with run length and is near-zero on short chats Advanced 2 min read

A multi-hour OpenAI agent re-sends its entire swelling transcript on every turn. Set a compaction threshold and the Responses API summarizes old turns server-side into one encrypted item that carries state forward in far fewer tokens.

๐Ÿ”’ Pro tip ยท Advanced

Unlock this tip โ€” and 54 more

This is one of 55 advanced, fact-checked tactics reserved for Pro. Get the full 77-tip library, a searchable archive, and a new tip every morning. Free for 7 days, then $9/mo.

Prefer to browse? The 22 Beginner tips are free forever.