As of 2026-11-02, the Responses Compaction guide and Python SDK 3.42.0 (2026-10-31) Agent context compaction settings both address long-session token growth. A common misread: “after compression the model still remembers tool schema, so I can stop sending tools.” The docs say the opposite—compaction items are encrypted and not for human reading; what keeps strict calls working is still Function Calling JSON Schema on Agent config or each request root. Harness split: Why the Agents API needs JSON more. Routing types: Decisions input_json.
After dozens of Agent turns you either pile transcript longer or turn on context_management with compact_threshold. If you send fewer tools after compact, the next function_call arguments may still look like JSON but no longer match your parameters schema—because the contract left the request.
What landed on 31 October
As of 2026-11-02, public evidence has two layers:
- Responses API: server-side compaction (
context_management: [{ "type": "compaction", "compact_threshold": N }]) and statelessPOST /responses/compact, documented in the official Compaction guide (guide updates continuously; not dated 10-31 alone). - SDK 2026-10-31: openai-python 3.42.0 changelog says “add agent context compaction settings”; Node 7.46.0 aligns. Agents hosted sessions can declare when to compress context—same idea as Responses compaction, not a second schema format.
Same-day SDK also shipped session review, tool settings, and other Agent fields—tool settings remain configuration JSON that declares tool names and schema, orthogonal to compaction.
What compaction compresses—and what it does not
Compaction guide highlights:
- Above threshold, the server replaces earlier dialogue with a compaction output item carrying “state needed to continue reasoning,” with fewer tokens.
- Compaction items are opaque: do not decode them into your
parametersobject. /responses/compactinput may include messages, tools, and other items; the returned window is the canonical input for the next hop; docs say do not prune that output.- Streams may emit
context_compacted-class semantics (guide table): earlier content was replaced—not that tool definitions are permanently written into model weights.
One line. Compaction manages history tokens; JSON Schema manages the tool input contract. Configure both explicitly.
Where to pin tools and schema
For self-hosted Responses loops, two layers:
- Request-root
tools: eachresponses.createstill carries fulltype: "function"andparameters(OpenAI JSON Schema subset; stricter withstrict: true). After compaction, if you hand-maintain the input array, do not assume tool definitions from early turns stay readable—if you keep only compact output plus new messages, you still need tools at the root. - Agents API Agent object: tool schema lives in Agent config; SDK 3.42.0 compaction settings only decide when to summarize the session—they do not replace the tool block. Session review reads session metadata, not a way to recover parameters from review JSON.
{
"agent_tools_ok": {
"tools": [
{
"type": "function",
"name": "update_ticket",
"description": "Update CRM ticket fields",
"parameters": {
"type": "object",
"properties": {
"ticket_id": { "type": "string" },
"status": { "type": "string", "enum": ["open", "closed"] }
},
"required": ["ticket_id", "status"],
"additionalProperties": false
},
"strict": true
}
]
},
"compaction_item_opaque": {
"type": "compaction",
"note": "Do not parse this as parameters schema"
},
"wrong_assumption": {
"input": ["compaction_item_only", "new_user_message"],
"tools": []
}
}
If you really send wrong_assumption after compact, the model may hallucinate field names; local Schema validation should reject such arguments.
Agents API sessions and tool settings
Agents API puts the harness on the server: you submit tool JSON when creating the Agent; compaction may fire server-side during session turns (depending on compaction settings configurable from 10-31). Integration notes:
- Updating the Agent tool list = changing configuration JSON, not editing compaction items.
- With MCP plugins, ChatGPT side still uses
inputSchema/payloadSchemacontracts; see MCP Events. Compaction does not merge those two schema layers. - Docs also warn: do not mix configuration updates with automatic compaction in odd ways in the same history; when you change reasoning effort or output format, after compact redeclare what you changed.
How to verify JSON after context_compacted
After compaction, each hop should still:
- Take
argumentsfromfunction_call(or Agentsrequired_action) → parse to an object. - Validate against the same tool’s
parametersschema in Agent config—not against the compaction item. - For structured final answers, keep using
text.formatjson_schema—compaction likewise does not stash output schema inside the opaque item.
Try it in JSON Toolbox
{
"call_ok": {
"name": "update_ticket",
"arguments": "{\"ticket_id\":\"T-9\",\"status\":\"closed\"}"
},
"call_bad": {
"name": "update_ticket",
"arguments": "{\"ticket_id\":\"T-9\",\"status\":2}"
},
"schema_ref": "agent_tools_ok.tools[0].parameters"
}
- Paste
agent_tools_okwithcall_ok/call_badinto JSON format. - Use the Function Calling page for
strictand subset rules. - Schema validation:
call_okpasses;call_badfails onstatustype/enum.
FAQ
Does compaction remove the parameters JSON Schema from the tools array?
It does not “migrate” schema into readable JSON for you; keep providing schema on the Agent or request root.
With previous_response_id chaining, do you still send tools?
Agent config or equivalent must still carry them; do not send only user messages while omitting tool definitions.
Can you strip tools from the window returned by POST /responses/compact before sending?
Do not prune compact output; add tools at the request root when needed.
After a context_compacted event, should you still validate arguments locally?
Yes—validate every call.
How does this split from the Decisions API article?
Decisions uses input_json/answers; this note is Responses/Agents compaction and Function Calling schema.
Summary
As of 2026-11-02, the 2026-10-31 SDK puts Agent context compaction in the spotlight, aligned with Responses context_management / /responses/compact: trade earlier dialogue for shorter input via opaque compaction items. Function Calling JSON Schema does not automatically “stay in context” so you can omit it—still pin it on Agent tool settings or each turn’s tools. Pass compact output through unchanged; keep validating arguments locally. Next step: run a tool call on a test Agent with compaction enabled and confirm pre- and post-compact validation use the same parameters, not the compaction item.