Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 3 min read

A human was about to approve the payment. Then your context compaction ran.

A one-line entry in the OpenAI Agents SDK changelog names a correctness bug that most agent stacks still have. A human was about to approve the payment. Then your context compaction ran. On 15 October 2026 the OpenAI A

A one-line entry in the OpenAI Agents SDK changelog names a correctness bug that most agent stacks still have.

A human was about to approve the payment. Then your context compaction ran.

On 15 October 2026 the OpenAI Agents SDK shipped a changelog line that reads like housekeeping:

defer automatic compaction for pending approvals

It is not housekeeping. It is a correctness fix, and it is worth understanding even if you never touch that SDK.

The collision

Automatic compaction keeps a long-running agent inside its context window by summarising or dropping older turns. Entirely sensible β€” without it, any agent that runs for hours eventually falls over.

Human-in-the-loop approval is also sensible. Before the agent moves money, files a return or releases a dispatch, a person signs off.

The problem is that these two good ideas run on completely different clocks.

To the runtime, an agent waiting at an approval gate looks identical to an idle session carrying a large history. There is no inbound traffic. The context is big. Compaction is exactly the thing you would want to happen. So it happens.

The sequence:

  1. The agent proposes a tool call that moves money.
  2. It pauses for approval. A person takes forty minutes, or until tomorrow morning.
  3. Meanwhile a threshold trips and compaction runs over the history.
  4. Approval comes back and the agent resumes β€” against a history in which the exact arguments it asked about have been compressed into prose.

The human approved one specific thing. The agent can now only reconstruct an approximation of it.

Nothing crashed. No exception was raised. The run completes and looks successful. That is what makes this class of bug expensive: the failure is silent, and it is in the audit trail rather than the output.

Why a summary is not an approval

A summary is lossy by design β€” that is the entire point of it. Compaction optimises for preserving meaning, because meaning is what the model needs to keep reasoning.

An approval needs something else entirely: exact arguments. Not the gist of the payment, the payment.

"Approved a vendor payment of around β‚Ή4,00,000 to the supplier discussed earlier" is a perfectly good summary and a completely useless authorisation record. Which supplier? Which invoice? Was it β‚Ή4,00,000 or β‚Ή4,05,000? Which bank account?

Compression that is lossless for reasoning is lossy for authorisation.

The structure that avoids it

1. A pending approval freezes the context it depends on. Nothing may summarise, trim or evict the turns an open approval references. This is precisely what the SDK change does.

2. The approval record lives outside the conversation. Store the exact call β€” tool name, full arguments, a hash β€” in your own store, not in the message history:

approval_id       appr_01J...
tool              pay_vendor
arguments         {"vendor_id": "V-2291", "invoice": "INV-88412",
                   "amount_paise": 40000000, "account": "...4471"}
arguments_sha256  9f2c...e4a1
requested_at      2026-11-07T11:04:22+05:30
decided_by        <user id>
decided_at        2026-11-07T11:49:08+05:30
decision          approved

3. On resume, execute from the approval record β€” never from the reconstructed history. Re-hash the arguments before dispatch and compare. If they do not match, you do not execute; you re-ask.

4. Keep compaction reversible while an approval is open. The same SDK added an optional compaction rollback item budget in 0.23.0, two weeks earlier. Being able to undo a compaction is a meaningfully different capability from being able to avoid one.

Two hard rules

Any optimisation allowed to run while a human is thinking must know what the human is thinking about. Compaction, cache eviction, history trimming, session expiry β€” each one is a performance feature that becomes a correctness bug the moment it runs during a human pause.

If you cannot replay the approved call exactly, you did not have an approval. You had a vibe.

The payoff

An approval stops being a UI step and becomes a durable record you can audit afterwards. Six months later, when someone asks who authorised a payment and exactly what they authorised, the answer is a row with a hash β€” not a summarised transcript that has to be argued over.

Honest limitation

I am reading changelog entries and reasoning from them. I am not reporting the maintainers' stated motivation, and I have not benchmarked any of this. The approval-record shape above is a design I use, not an industry standard. All figures are illustrative.

Checkable references

  • openai-agents-python CHANGELOG, release 0.24.0 (15 October 2026) β€” "defer automatic compaction for pending approvals"
  • openai-agents-python CHANGELOG, release 0.23.0 (1 October 2026) β€” optional compaction rollback item budget

One open question

In your stack, what else is allowed to run while a human is deciding β€” and has anyone actually checked?

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.