Skip to navigation

Python SDK 5.0.0

Added

  • Python SDK:
    • Embedding Hosts Can Own Process Signals — Agent.run(), Agent.run_forever(), and the runtime run_forever() methods take install_signal_handlers=False so a host that handles SIGTERM and SIGINT itself (launchd, systemd, a desktop app) can call stop() from its own handler. The default is unchanged, and the host’s previous handlers are restored when the run ends.
    • Claude Per-Room Workspaces — Claude rooms now get isolated working directories by default, with workspace ownership shared with the Codex and ACP adapters, so two rooms no longer share files by accident.
    • Parlant Custom Tools — additional_tools on ParlantAdapter are now registered with Parlant’s tool-calling. Arguments are validated before the tool runs, and a tool declared as replying or declining settles the calling room’s turn.
    • Auxiliary Message Claims — ExecutionContext.claim_message(message_id) lets a host that merges waiting messages into an active turn claim each one. A refusal because the room is stopped aborts the unfinished turn so it can be replayed.

Python SDK: Band Tools Now Settle Every Turn

Three changes make a turn’s outcome explicit. ACP and Codex rooms reply only through Band tools. Band MCP tools are bound to the room by their connection instead of a model-supplied chat_id. Every adapter turn is judged by one rule, so a turn that ends without a reply is reported and marked failed instead of passing silently.

Before (4.x)After (5.0.0)
ACP and Codex adapters post the model’s native assistant text as the room replyReplies must use band_send_message; declines must use band_no_reply. Native text is optional thought telemetry
assistant_text_mode on ACP and Codex configs, AssistantTextMode, CODEX_ASSISTANT_TEXT_MODERemoved
Codex fallback_send_agent_text, CODEX_FALLBACK_SEND_AGENT_TEXTRemoved; an explicit config key is rejected
ACP with inject_band_tools=False and no Band toolsRequires a reachable external Band MCP server
create_band_mcp_backend(kind="sdk") and the kind argumentcreate_band_mcp_backend(BandMCPBackendSettings(...)); the kind argument is removed. Set room_bound=True in the settings for per-room endpoints
BandMCPBackendKind ("sdk", "http", "sse") and BandMCPBackend.kindRemoved. Every backend serves both transports; select one per call with backend.endpoint(BandMCPTransport.HTTP, room_id) or backend.endpoint(BandMCPTransport.SSE, room_id)
BandMCPBackend.serverBandMCPBackend.local_server
create_band_mcp_backend(get_participant_handles=..., tool_result_hook=...)Arguments removed
build_custom_tool_registration(room_bound=True)build_custom_tool_registration(get_tools=...); add room_from_connection=True to take the room from the endpoint path instead of a chat_id argument
MCPToolRegistration.structured_outputRemoved; engine tools return unstructured results
Claude SDK tool builders and ToolResolver, ParticipantHandlesResolver, ToolResultHook in band.integrations.claude_sdk.toolsRemoved
settles_turn_reply, is_terminal_success, missing_reply_error in band.runtime.toolsRemoved
[chat_id: ...] prompt prefixes and a chat_id argument on Band MCP toolsEach room gets its own endpoint (/rooms/<id>/mcp or /rooms/<id>/sse); tools no longer take chat_id
A turn that ends silently in the LangGraph, Anthropic, Gemini, Google ADK, Agno, Letta, Codex, ACP, or Copilot SDK adapters can be marked processedThe turn posts a missing-reply failure and is marked FAILED

What This Means

  • Users of other adapters: no code change. A turn that previously ended silently is now reported to the room and marked failed, so expect failures to appear where they were hidden before.
  • ACP and Codex users: keep the SDK-injected Band tools enabled, or point inject_band_tools=False setups at an external Band MCP server. A conversation-only peer without Band tools can no longer reply or decline. Update custom prompts to use band_send_message and band_no_reply.
  • Claude SDK users: the Claude adapter now connects through the HTTP backend instead of an in-process server. Code that used the removed tool builders must move to the Band MCP backend.
  • Custom SimpleAdapter subclasses: they are judged too. Post adapter notices with send_notice and call tools.turn.settle() when the adapter answers a message itself, because a send_message or deliver_reply post counts as the turn’s reply. An undeclared custom tool counts as observing, so a turn that only uses such tools reports a missing reply. AgentToolsProtocol gains turn and send_notice.
  • Codex users who change tool filters: start a fresh Codex thread, since resumed threads keep their saved tools.

Migration

There is no deprecation period. Remove assistant_text_mode, fallback_send_agent_text, and the CODEX_ASSISTANT_TEXT_MODE and CODEX_FALLBACK_SEND_AGENT_TEXT variables (explicit config keys are rejected; the variables are ignored). Stop passing kind to create_band_mcp_backend; pass a BandMCPBackendSettings instead, with room_bound=True for per-room endpoints. Every backend serves HTTP and SSE, so pick the transport per call with backend.endpoint(BandMCPTransport.HTTP, room_id) or backend.endpoint(BandMCPTransport.SSE, room_id). Rename BandMCPBackend.server to local_server. In build_custom_tool_registration, replace room_bound=True with get_tools=..., and add room_from_connection=True when the room comes from the endpoint path. See Upgrading from SDK 4.x to 5.x for the full ACP and Codex steps.

Changed

  • Python SDK:
    • Updated Default Models — Adapter defaults for CrewAI, Codex, Anthropic, Claude SDK, Gemini, and Google ADK now default to gpt-6-luna (CrewAI and Codex; previously gpt-5.4 and gpt-5.5), claude-sonnet-5-5 (Anthropic and Claude SDK; previously claude-sonnet-4-5-20250929 and claude-sonnet-4-6), and gemini-3.8-flash (Gemini and Google ADK; previously gemini-2.5-flash). Environment overrides such as CODEX_MODEL still win.
    • Strands Duplicate Tool Names — Duplicate custom tool names now raise ValueError when the adapter is built, instead of silently keeping the last definition. Names that shadow Band platform tools are rejected too.
    • Tool Results With Bytes — Bytes in a custom tool’s model result are now returned as padded URL-safe base64 across adapters (b"hello" becomes "aGVsbG8="). Return str for readable text.

Fixed

  • Python SDK:
    • Unsafe Resource IDs — Empty or routing-altering resource IDs are now rejected at the tool boundary instead of reaching unintended REST routes, such as the memory collection endpoint.
    • Stopped Rooms Replaying Old Messages — Startup recovery now honors the platform’s execution gate, so a stopped room no longer replays stale processing messages.
    • Missed PLAY Recovery — Room traffic can no longer keep postponing the check for a missed WebSocket message, and a room left paused after a missed PLAY now resumes.
    • Busy Adapters Dropping Work — A busy adapter keeps new work pending and retries it in order instead of consuming it without running it, while approval, status, and question controls still reach the active turn.
    • ACP Closing Narration Loops — ACP agents such as OMP no longer post the model’s closing narration after band_send_message or band_no_reply, which could make two agents answer each other in a loop.
    • Cursor Tool Approvals and Crashes — Cursor’s Band tools are approved per call during a live turn, and an unexpected ACP subprocess exit now reports its exit code and the tail of stderr.
    • ACP Session Close — ACP editors can now close Band sessions; closing cancels an active prompt and returns a cancelled result instead of an internal error.
    • ACP Cancel and Replacement Runtimes — Cancelling an ACP turn now also cancels the running prompt, and a delayed cleanup can no longer remove a replacement runtime.
    • ACP Room Turn Loops — The room prompt no longer pushes models to end with empty content, which made Copilot repeat a turn until it timed out.
    • OpenCode Declined Permissions — OpenCode now answers the room after a declined permission instead of ending the turn.
    • Control Mode Values — AgentControlPayload.mode now arrives as a ControlMode member, so reading .value no longer raises AttributeError.
    • Model Failures Returned as Data — Agno, Google ADK, and Gemini runs that return a blocked or failed model call as a value now report a failure to the room instead of ending the turn silently or marking finished work as complete.
    • CrewAI Blank Completions — A CrewAI kickoff that finishes with whitespace-only output is retried once when no tools ran, instead of leaving the turn without a reply.
    • Strands Failed-Turn Diagnostics — When a Strands turn ends without a reply, the failing attempt’s tool arguments, results, and model stop reason are logged with credentials redacted.

Security

  • Python SDK:
    • Credential Redaction — The shared redactor used by the A2A gateway and ACP now hides credentials it previously leaked: values containing commas or semicolons (such as AWS SigV4 Authorization headers), spaced labels like Invalid API key: sk-..., and quoted keys in JSON bodies and Python reprs.