Applied AI
An agent memory limit can cut a reasoning response in half
Test how OpenAI Agents SDK session limits trim reasoning and message items before long-lived agents reach production.
November 18, 2026
A session that stays small can still fail on its next turn. In an open Agents SDK issue, a reporter found that SessionSettings(limit=N) could retain a message while dropping its paired reasoning item, leading to an API 400 in the reported SDK version. The session guide describes the limit as an item count. That distinction matters when one logical response spans multiple items.
Reproduce the boundary, not just a short chat
Use the exact SDK and model planned for deployment. Create enough turns to cross the session limit, including tool calls and responses with reasoning items. Then inspect the items sent on the next request. A five-turn demo can miss a defect that appears only when the oldest item is trimmed.
Preserve complete response units
Treat an assistant response and its required companion items as a unit when deciding what history to keep. If your implementation cannot guarantee that, use a higher limit or a summarization boundary that emits a valid new turn. Test both after a tool call and after an interrupted run. Do not assume that increasing the number alone permanently solves growth.
Make the failure visible
Record the configured limit, SDK version, item types, and failing request identifier in an internal trace, without storing sensitive message content unnecessarily. An API 400 after many successful turns should lead to a session-integrity check before a model outage diagnosis.
Adovo’s view
Memory budgets are protocol decisions. A smaller history is useful only when the remaining conversation is still structurally valid.
