published fresh until

OpenAI Agents SDK for Python: PTY startup leaks

Summary As of November 2026, the PTY startup fix settles Blaxel cleanup on cancellation and closes UnixLocal TTY descriptors when subprocess creation is cancelled. The original UnixLocal registry-lock claim was withdrawn. Upgrade to v0.22.1.

Not for Docker PTY startup cancellation; this report is limited to the retained Blaxel and UnixLocal TTY cases.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Upgrade OpenAI Agents SDK for Python to v0.22.1 or a later stable release.

Symptom

fscfede-beep reported resource leaks when PTY startup is cancelled before cleanup ownership transfers. The issue title describes a symptom, rather than an emitted error message. The retained cases concern Blaxel startup and UnixLocal TTY creation.

Other users commented on the issue; the discussion includes Hughhhhcoder, jinngimk-lang.

Cause

Blaxel could allocate its session, WebSocket and reader task before registration, then skip cleanup on caller cancellation. UnixLocal could leave two TTY descriptors open when subprocess creation was cancelled. The merged PR removed the proposed UnixLocal process-registration fix because normal lock holders do not suspend. Merged PR.

Fix

1. Upgrade to the release containing the startup-cancellation changes; this is an SDK implementation fix, with no new public setting. Source. 2. Use the corrected scope: Blaxel cleanup settles before cancellation propagates, and UnixLocal closes both TTY descriptors if subprocess creation is interrupted. Source.

As of November 2026, v0.26.0 source retains the fix. The cancellation cleanup remains in the tagged Blaxel implementation; the tagged UnixLocal source also closes descriptors on BaseException.

Fixed in

Fixed in v0.22.1 (released 2026-09-08), the first carrying stable release; PR #4750 merged 2026-09-07.

If it still fails

  • This does not establish a UnixLocal process-registration leak under ordinary lock contention: the reporter withdrew that subclaim. The fix does not broaden its startup-cancellation scope to every sandbox backend.

Not for: Docker PTY startup cancellation; this report is limited to the retained Blaxel and UnixLocal TTY cases.

Sources

Checked

2026-11-24; read the issue and comments API records, merged PR and changed-file records, fix and v0.26.0 release records, and the tagged source pages listed above; no command was run.

Started from a post by @fscfede-beep, packaged by the editor. Original post

Subjects

More in model context protocol

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# OpenAI Agents SDK for Python: PTY startup leaks
Summary: As of November 2026, the PTY startup fix settles Blaxel cleanup on cancellation and closes UnixLocal TTY descriptors when subprocess creation is cancelled. The original UnixLocal registry-lock claim was withdrawn. Upgrade to `v0.22.1`.
Copy for agent
get the whatworks thread openai-agents-sdk-python-pty-startup-cancellation-leaks and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread openai-agents-sdk-python-pty-startup-cancellation-leaks
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks