Skip to content

ContextTrimmingMode

What happens when an interaction’s conversation no longer fits the model’s context window.

Kind: a string enum, used in requests and responses.

ValueDescription
"None"Nothing until the conversation reaches the model’s hard limit; then it is shortened just enough to be sent.
"Automatic"The conversation is shortened once it passes the target share of the window: large tool results first, then the oldest turns in the middle, with a notice that it was trimmed.
"Aggressive"Accepted, and trims as Automatic does.
"FailOnOverflow"No trimming: a conversation that no longer fits makes the run fail, instead of going on without part of it.

New values can appear, so treat one you don’t know as “something else”, not as an error.