deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

OpenAI Agents SDK now defers context compaction while human approvals are pending

OpenAI's Agents SDK 0.24.0 defers automatic context compaction when an approval is pending. A dev.to post explains why the silent bug matters for most agent stacks.

OpenAI Agents SDK now defers context compaction while human approvals are pending

What shipped

On 15 October 2026, release 0.24.0 of the OpenAI Agents SDK for Python included a changelog entry reading "defer automatic compaction for pending approvals." A dev.to post argues this is not routine housekeeping but a correctness fix for a failure mode most agent frameworks still carry: an agent paused at a human-approval gate can have its conversation history summarised out from under it while the human is still deciding.

Two features on different clocks

According to the post, automatic compaction and human-in-the-loop approval are each sensible on their own but collide when combined. Compaction keeps a long-running agent inside its context window by summarising or dropping older turns. Approval gates pause an agent before it moves money, files a return or releases a shipment until a person signs off.

The problem, as the author lays it out, is that to the runtime an agent waiting at an approval gate looks identical to an idle session carrying a large history: no inbound traffic, a big context — precisely the conditions under which compaction is designed to fire. So it fires. The post describes the resulting sequence: the agent proposes a tool call that moves money, pauses for approval, the human takes forty minutes or until the next morning, a threshold trips and compaction rewrites the history into summaries, and when approval finally arrives the agent resumes against an approximation in which the exact arguments it asked about have been compressed into prose.

Nothing throws an exception. The run completes and looks successful — which, the author argues, is what makes this class of bug expensive. The failure is silent, and it sits in the audit trail rather than the output.

Why a summary cannot authorise a payment

Compaction is built to preserve meaning, because meaning is what the model needs in order to keep reasoning. An approval needs something stricter: the exact arguments. The post's illustration — a history entry recording approval of a payment of roughly ₹4,00,000 to "the supplier discussed earlier" — reads fine as a summary but answers none of the questions an auditor will ask: which supplier, which invoice, which exact amount, which bank account. Compression that retains enough meaning for reasoning can still discard the specifics an authorisation depends on.

The structure the post recommends

The author proposes four rules, while noting they are a personal design rather than an industry standard:

A pending approval should freeze the context it depends on, with nothing permitted to summarise, trim or evict the turns an open approval references — which is what the SDK change does. The approval record should live outside the conversation, capturing the tool name, full arguments and a hash of those arguments, alongside who decided and when. On resume, the agent should execute from that record, never from reconstructed history, re-hashing the arguments and comparing before dispatch; a mismatch means re-asking the human, not executing. And compaction should remain reversible while an approval is open — the post points out that the same SDK added an optional compaction rollback item budget in release 0.23.0, dated 1 October 2026, which is a different capability from simply avoiding compaction.

Caveats

The author is explicit about the limits of the analysis. It is reasoning drawn from changelog entries, not a report of the maintainers' stated motivation; nothing was benchmarked; the approval-record format shown is the author's own design; and all figures in the piece are illustrative.

Why it matters

The lesson extends well past one SDK. Any optimisation permitted to run during a human pause — compaction, cache eviction, history trimming, session expiry — is a performance feature that becomes a correctness bug the moment it executes while someone is deciding. And an approval that cannot be replayed exactly is not really an approval at all. Teams running agents with human sign-off gates get a concrete checklist item from this: audit what is allowed to run during the pause, and move approval records out of the transcript the model sees, so that six months later the answer to "who authorised this and what exactly did they authorise" is a stored row with a hash rather than a summarised conversation.

  • #openai
  • #agents
  • #human-in-the-loop
  • #context-management
  • #llm

Related posts