OpenAI released Python SDK 3.42.0 on October 31, 2026 UTC, according to its GitHub release notes. The update gives developers new options for a beta agent session, including when compaction runs, when eligible actions are reviewed and which tools a session can use. It also adds a markup input for image editing.
When does context compaction happen?
The SDK exposes context compaction settings for beta agents, sessions and scheduled agent runs. Developers can choose background or blocking compaction. The change notes say the client can also read the effective settings, which helps distinguish what the caller requested from what a particular agent or session is using.
The maintainers say the default is background compaction and document a setting to request blocking behavior. They also flag a tradeoff: background compaction may increase token usage. A team testing the new option can compare the same long session under both modes rather than assume the default is cheaper.
What can you change on an agent session?
The SDK accepts review settings when a developer creates or updates a session. The change notes describe an automatic action review mode for eligible actions. For an update, the new default applies to new root turns. Existing turns and their subagents keep their review mode.
The same change lets an update replace the session's tool list. If a service uses both settings, test them separately: check the mode applied to a new turn, then check that the updated session has the tool list you intended.
What is new for image editing?
The image edit API accepts a transparent PNG markup overlay. The change notes describe it as a layer over the first input image that guides the edit. This gives a developer a way to supply visual directions alongside the request. The published change describes an input option; it does not establish that the edited output will preserve every detail outside the marks.
