Python SDK 6.0.1
Fixed
- Python SDK:
- Agents Staying Offline After a Clean WebSocket Close — A live agent now reconnects and catches up on its rooms after the platform closes its connection normally, instead of staying offline until restarted. An agent superseded by a newer session with the same key still stops for good.
Security
- Python SDK:
- WebSocket Credential Exposure — Connection diagnostics and retained error details no longer expose credentials after a connection attempt.
Python SDK 6.0.0
Added
- Python SDK:
- Shared Resource Cleanup — Register async callbacks with
adapter.add_cleanup(client.aclose)before startup. TheAgentorOneShotInvokerthat runs the adapter calls them in reverse registration order when it stops, after in-progress turns and framework teardown have finished. If a callback fails, stopping again retries only the failed callbacks; callbacks that already succeeded do not run again. - Shared-Tool Examples — Runnable examples demonstrate a shared HTTP client, a persistent SQLite connection, and a temporary draft workspace with cleanup run by the agent. After registered resources have been disposed, create fresh resources and a new adapter and agent. Resources shared across adapters stay your application’s to close.
- Stopped-Room Polling — Set
SessionConfig.stopped_resync_secondsorSTOPPED_RESYNC_SECONDSto reduce polling for paused rooms without slowing active rooms. Unset uses the base interval; longer values can delay discovery of a missed resume by that interval. - Turn Wind-Down Timeout — Claude SDK and ACP adapters, including OMP (oh-my-pi), Cursor, and Copilot ACP, expose
turn_settle_timeout_s, how long a room’s unfinished turn has to wind down before it is cancelled when the agent leaves the room or shuts down.
- Shared Resource Cleanup — Register async callbacks with
Python SDK: Runtime Types Removed, SessionConfig and Extras Reworked
Python SDK 6.0.0 removes band.runtime.types, converts SessionConfig to Pydantic settings, splits framework extras across incompatible OpenAI major versions, changes NOOA custom-tool calls, and moves the Docker Sandbox kit to the v3 workload format.
What This Means
- New applications: Use the current adapter examples. Install
pydantic-aiseparately fromcrewai,strands, andnooa, whose OpenAI requirements do not overlap. - Existing applications: Update
band.runtime.typesimports,SessionConfigusage, adapter dependency pins, and NOOA custom-tool calls. Applications that call native adapter internals directly must also update their cleanup and session-manager calls. - MCP and platform-tool users: Built-in Band tool arguments are unchanged. The NOOA
argumentswrapper applies only to portable custom tools, not to platform tools or their MCP schemas.
Migration
Runtime imports. band.runtime.types is removed, with no compatibility aliases. Import each symbol from its owning module:
Existing intentional exports such as from band.runtime import SessionConfig remain available.
Session settings and native-adapter timing.
Audit environment variables such as IDLE_RESYNC_SECONDS before upgrading: they can now affect SessionConfig() without a code change. Invalid values for known fields fail at construction with Pydantic validation errors. Misspelled keyword names are silently ignored, so verify every field name. SessionConfig(True) can ignore IDLE_RESYNC_SECONDS. turn_settle_timeout_s, the time an unfinished turn gets to wind down on room leave or shutdown, still defaults to 10 seconds. retention.transition_timeout_s separately limits how long a caller waits for a room’s startup or cleanup to report its result; an unfinished one keeps running.
Framework dependencies. Update direct pins and regenerate your application’s lock file.
Run Pydantic AI separately from CrewAI, Strands, and NOOA/LiteLLM because their OpenAI requirements do not overlap. Agents in separate processes can still collaborate in the same Band rooms. LangGraph accepts either OpenAI major, including OpenAI 2 when installed with Strands. NOOA’s platform support is unchanged: Python 3.12–3.13 on Linux and macOS, not Windows.
NOOA custom tools. Portable custom-tool calls now take one keyword-only arguments dictionary. The old signature is not supported.
For order_id = Field(validation_alias="orderId"), pass arguments={"orderId": "A1"}. Input models, validators, handlers, and additional_tools=[(InputModel, handler)] registration remain unchanged. Built-in calls such as self.room.band_send_message(content=..., mentions=...) keep their named arguments. Update handwritten NOOA scripts, prompts, and test helpers.
Direct native integrations. Ordinary adapter users do not need to manage these internals. Applications calling them directly must follow the new per-room lifecycle contract:
Docker Sandbox workloads. The SDK’s Docker Sandbox tooling now targets workload format v3 for the Docker Sandboxes CLI (sbx). Use either published 6.0.0 workload:
docker.io/bandhq/band-python-kit:6.0.0ghcr.io/band-ai/band-python-kit:6.0.0
For custom kit descriptors and build pipelines, follow the v3 build and release guide. Removing/recreating a sandbox deletes its scoped secrets: preserve access to credentials, restore bindings, and reapply network grants. Workspace-only edits can use stop/start instead.
Changed
- Python SDK:
- Room Startup and Cleanup Isolation — Slow startup or cleanup in one Codex, Claude SDK, or ACP room no longer holds up unrelated rooms. If a room’s cleanup does not finish, the SDK keeps that room’s old session and does not start a replacement for it until cleanup completes or is retried. Codex process recovery resumes the same thread and fails the turn if resume is refused rather than silently discarding private context. Automatic idle suspension is not enabled.
- Breaking:
SessionConfigIs Now Pydantic Settings — Pass fields by keyword, replacedataclasses.asdictandreplacewithmodel_dump()and a newSessionConfig, and audit same-name environment variables such asIDLE_RESYNC_SECONDS, which now apply toSessionConfig(). Negativeturn_settle_timeout_sis rejected. See Migration. - Breaking: Pydantic AI Extra Cannot Share an Environment — The
pydantic-aiextra now needs OpenAI 3 and cannot co-install withcrewai,strandsornooa. Run it separately and update your pins; see Migration. - Breaking: NOOA Custom Tools Take
arguments— Portable custom-tool calls pass one keyword-onlyargumentsdictionary. See Migration. - Breaking: Native Adapter Lifecycle Calls Changed — Applications that call ACP or
ClaudeSessionManagerlifecycle methods directly must use the per-room contract in Migration. - Breaking: Docker Sandbox Kit Uses Workload Format v3 — Create sandboxes from the published v3 workload with
sbx0.47.0. See Migration.
Removed
- Python SDK:
band.runtime.typesModule — The module is removed with no compatibility aliases. Import each symbol from the module that owns it; the Migration section lists every new location.- Claude Session Manager Methods —
ClaudeSessionManager.start(),get_or_create_session(),invalidate_session()andcleanup_all(), therelease_workspaceargument ofcleanup_session(), and ACPcleanup_all(final=...)are removed. Applications that call them directly follow the Direct native integrations table in Migration.
Fixed
- Python SDK:
- Stopped-Room Responsiveness — Stopping an agent while it handles a contact event no longer freezes the agent. Before, a stopped contact-hub room spun in a loop and froze every room. A stop that arrives while a contact-hub turn is starting is no longer lost, and queued messages are replayed in the order received when the room is resumed.
- Backend Cancellation —
STOP,INTERRUPT, and cancelled turns now ask the backend (such as the ACP agent, Codex or Claude) to cancel the work it is already doing, and the next turn waits for that cancellation to finish before it starts. This covers native adapters and remote adapters; Parlant also stops session processing and preamble generation. This does not guarantee termination of an unreachable remote backend, and it does not cover a stop that arrives before the backend has started the work. For example, an A2A task without streaming cannot be cancelled before its first event. - Shutdown Ordering — CrewAI native workers and Flow branches, ACP prompt children, A2A gateway executors, and Slack ingress handlers finish their in-flight work before the shared resources they use are closed.
- Pydantic AI Turn Recovery — A turn that already completed through tools no longer fails only because Pydantic AI exhausts its output retry budget. The adapter preserves the turn history and the original retry diagnostic.
- Terminal Declines — Successful
band_no_replycalls end Anthropic and Strands turns without another model call. SDK-owned LangGraph loops and Pydantic AI completion hooks also avoid redundant requests after successful decline batches; failed tool batches still permit recovery. Caller-owned LangGraph routing is unchanged. - Strands Tool Calls and Follow-Up History — OpenAI-backed Strands examples use the Responses provider so supported function tools can execute, and follow-up turns preserve valid tool-result ordering for Responses and Bedrock.
- Google ADK Retry Budgets —
max_retriesnow bounds extra generation attempts: the default is two retries, while zero means one attempt. Transient generation failures can recover without replaying completed tools or the runner. - Unconsumed Context — If converting room history or setting up a NOOA agent fails, the room history and pending participant and contact updates are kept and delivered on the retry instead of being dropped. A NOOA agent that failed to be replaced no longer reuses the previous session’s memory. Original failures still propagate and use the normal retry budget.
- Parlant Identity and Tool Selection — Mentions of the agent, in live messages and in replayed history, now use the agent name Parlant shows in its prompt, so Parlant no longer treats a message addressed to it as addressed to someone else. Parlant now explicitly checks whether the reply, decline and state-changing Band tools apply before it runs them.
- Message-Post Diagnostics — Recipient parsing failures after a successful delivery report
MessagePostErrorkindunconfirmed_recipient, explicitly stating that the message was delivered and must not be resent. Missing-room mentions reportmentioned_participant_not_in_room; MCP preserves the classification without suggesting an unsafe resend. - Windows Codex Teardown — Stdio process descendants are reaped before room workspaces are released, including failed startup and declined/timed-out approvals. If cleanup does not finish, the room workspace is kept so cleanup can be retried.
- Control Signal Handling — A slow agent-wide STOP, which waits for each room’s turn to wind down, no longer delays handling of a takeover notice (supersede) from a newer connection of the same agent. Interrupt, stop and resume signals still apply one at a time, in the order received.
Security
- Python SDK:
- Sandbox Credential Handling — Provisioning failures no longer print the one-time agent key when credential persistence fails, and sandbox command timeout errors are sanitized.