HomeNews

OpenAI SDK 3.42.0 Adds Agent Context Compaction

Debayan
Debayan
•
Nov 1, 2026 2:13 AM
•
0
 min read
Select Emergent as your Preferred news source
OpenAI SDK 3.42.0 Adds Agent Context Compaction

💡 TL;DR

  • OpenAI released Python SDK 3.42.0 on October 31, 2026, with agent context compaction settings that developers can now configure client-side.
  • The update introduces session review, experimental time awareness for agents, and organization external key management for tighter credential control.
  • WebSocket improvements include recovery, delivery reporting, warmup support, and a fix preserving refusal output in helpers.

OpenAI released Python SDK version 3.42.0 on October 31, 2026, shifting agent context compaction from server-side opacity to client-side configuration. The update gives developers direct control over when and how agent context gets summarized mid-run, alongside session review tools, experimental time awareness, and tighter credential management. For teams building multi-turn agent workflows, the compaction setting is the headline feature: a knob that was previously invisible is now programmable in your own call.

Agent context compaction moves client-side

The core addition is configurable context compaction across beta agents, sessions, and scheduled runs. Previously, OpenAI handled summarization server-side when agent conversations grew too long. Version 3.42.0 surfaces that logic as a client parameter, letting developers choose between background compaction (non-blocking) or blocking compaction (synchronous). This matters for workflows where you need deterministic control over when context gets compressed, or when you want to inspect the compacted state before proceeding.

The release notes list the change as "add agent context compaction settings," and it applies to all beta agent endpoints. If you run long-lived sessions or scheduled agent tasks, you can now tune compaction behavior to match your latency and consistency requirements.

Session review and tool settings

Session review is the second major addition. OpenAI now exposes an API surface for reviewing agent sessions after they complete, a feature that simplifies debugging and audit workflows. The release notes also mention "agent tool settings," though details are sparse. Together, these changes suggest OpenAI is building out a fuller management layer around agent lifecycle, not just execution.

Experimental time awareness rounds out the agent updates. The SDK changelog does not specify whether this is calendar awareness, elapsed-time tracking, or both, but the "experimental" label signals it may evolve in future releases.

Security and credential scoping

Version 3.42.0 introduces organization external key management, a feature aimed at enterprises managing API credentials across teams or third-party integrations. The update also scopes callable API keys to each request, reducing the risk of credential leakage across concurrent operations. For multi-tenant applications or workflows that invoke OpenAI APIs from user-controlled contexts, this tighter scoping is a meaningful security improvement.

WebSocket and telephony improvements

Real-time telephony users gain SIP DTMF commands and delivery events, expanding programmatic control over voice sessions. WebSocket improvements span three areas:

  • Recovery and delivery reporting got an unspecified improvement, likely reducing dropped messages or improving reconnect logic.
  • Warmup support was added, letting clients preload WebSocket connections before active use.
  • A bug fix now preserves refusal output and authentication state in WebSocket helpers, closing a gap where refusals or auth errors could be swallowed.

Release date and availability

Officially released on October 31, 2026, version 3.42.0 is available now via PyPI. The update is a drop-in upgrade for most projects, though the new context compaction settings require opt-in configuration if you want to override default behavior. OpenAI published the release notes on its GitHub repository and the Python SDK changelog.

What this means

This release signals OpenAI's push to give developers finer-grained control over agent runtime behavior. Context compaction was a black box; now it is a tunable parameter. Session review was missing; now you can programmatically inspect agent runs post-execution. For production agent deployments, these changes reduce guesswork and improve observability. The credential scoping and external key management additions also reflect enterprise adoption patterns, where multi-tenant and cross-organization credential handling is table stakes. If you are building stateful agent workflows on OpenAI, 3.42.0 is worth upgrading for the compaction and session review features alone.

About the writer

A Growth Operator with 10+ years of experience working across SaaS, Education and AI. Love playing with data and numbers.

Start Building
on Emergent today
Try Emergent