Skip to navigation

Python SDK 4.0.0

Added

  • Python SDK:
    • Claude SDK Turn Timeout — A new turn_timeout_s setting on ClaudeSDKAdapterConfig interrupts a Claude SDK turn that runs longer than the limit, and the room receives a failure with code timeout. It is off by default.
    • ACP Client Workspace Root — ACPClientAdapterConfig.cwd (and the Cursor, Copilot, and OMP configs built on it) is now the root under which each room gets its own workspace; it cannot be combined with workspace_for_room. Generic ACP raised an error for cwd in 3.3.0.

Python SDK: Adapters Now Take a Typed Config

Every framework adapter is now built from one typed, plain-data XAdapterConfig plus keyword-only live objects, instead of a long list of flat keyword arguments.

BeforeAfter
AnthropicAdapter(api_key=..., prompt=...)AnthropicAdapter(AnthropicAdapterConfig(provider_key=..., custom_section=...))
GeminiAdapter(api_key=..., prompt=...)GeminiAdapter(GeminiAdapterConfig(provider_key=..., custom_section=...))
CrewAIAdapter(system_prompt=...)CrewAIAdapter(CrewAIAdapterConfig(backstory=...))
ClaudeSDKAdapter(model="...", cwd="...", approval_mode="manual", approval_wait_timeout_s=120)ClaudeSDKAdapter(ClaudeSDKAdapterConfig(model="...", cwd="...", approvals=ClaudeApprovalOptions(mode="manual", wait_timeout_s=120)))
ClaudeSDKAdapter(cli=ClaudeCLIOptions(...))ClaudeSDKAdapter(ClaudeSDKAdapterConfig(cli=ClaudeCLIOptions(...)))
DONT_ASK_PERMISSION_MODE / AUTO_PERMISSION_MODEClaudePermissionMode.DONT_ASK / ClaudePermissionMode.AUTO (import from band.adapters.claude_sdk)

The other Claude approval settings are renamed inside ClaudeApprovalOptions: approval_text_notifications is text_notifications, approval_timeout_decision is timeout_decision, max_pending_approvals_per_room is max_pending_per_room, and approval_authorized_senders is authorized_senders.

notest
import yaml
from band import Emit
from band.adapters import ClaudeSDKAdapter, ClaudeSDKAdapterConfig
host_yaml = """
model: sonnet
turn_timeout_s: 600
"""
adapter = ClaudeSDKAdapter(
ClaudeSDKAdapterConfig.model_validate(yaml.safe_load(host_yaml)),
additional_tools=[...],
emit=Emit.TOOL_CALLS,
)

What This Means

  • New SDK users: build each adapter from its XAdapterConfig. Configs hold plain data only, so they load directly from YAML or JSON, and an unknown or misspelt setting fails at load with a validation error.
  • Existing SDK users: move every flat setting into the adapter’s config. LLM clients, graphs, factories, and callbacks stay keyword-only constructor arguments next to config.
  • Env-based configs: configs that subclass EnvAdapterConfig (for example Letta’s LETTA_* variables) resolve each setting in the order explicit value, environment variable, default.
  • A2A, Slack, and generic ACP users: config is required, since these have no usable default (A2A endpoint, Slack apps, ACP command).
  • Letta users: LettaAdapterConfig(api_key=...) is still accepted as a deprecated alias for provider_key.
  • Copilot SDK, ACP, Slack, and A2A users: these configs are now frozen pydantic models instead of dataclasses, so use model_copy(update=...) instead of dataclasses.replace. Duplicate Slack app slugs are refused when the adapter is built.

Migration

The removed aliases fail immediately. Replace Anthropic and Gemini api_key, anthropic_api_key, and gemini_api_key with provider_key and prompt with custom_section, and CrewAI system_prompt with backstory, then move the remaining settings into the adapter’s config.

Changed

  • Python SDK:
    • Claude SDK Config Validation — approvals.wait_timeout_s must now be less than turn_timeout_s, and the ClaudePermissionMode.DONT_ASK + approvals check now runs when the config loads instead of when the adapter is built.
    • Credential Redaction — API keys and tokens on adapter configs no longer appear in repr output.

Fixed

  • Python SDK:
    • Refused Claims No Longer Spend Retries — A message whose claim was refused under load no longer burns a retry attempt, so it is no longer marked failed without ever running.
    • Claude Thoughts on Opus 4.7+ — Emit.THOUGHTS now posts thinking summaries on Opus 4.7 and later models instead of nothing.
    • Duplicate codex-acp Replies — Replies sent through band_send_message by codex-acp are no longer posted a second time.
    • Rejected Room Joins — A room join that fails is now retried after 1, 2, 4, 8, and 16 seconds instead of waiting for a WebSocket reconnect; the reconnect path remains the fallback.
    • CrewAI Repeated Questions — CrewAI coordinators no longer re-ask peers indefinitely, because their own successful posts now stay in the room history.
    • Contact Hub Task ID — An invalid ContactEventConfig.hub_task_id is now rejected when the config is built instead of crashing the agent at startup with a 422.

Python SDK 3.3.0

Added

  • Python SDK:
    • band_no_reply — Platform tool that ends a turn without posting a chat message. The optional reason is only logged locally.
    • Custom Tool Turn Effects — declares_turn_effect(...) from band.runtime.custom_tools marks what a successful custom tool call means for the turn: TurnEffect.ACT, REPLY, or DECLINE. An undeclared tool counts as OBSERVE, so a turn that ends silently after only such tools reports a no-response error. Honored by the Claude SDK, CrewAI, Pydantic AI, Strands, Codex, Copilot SDK, OpenCode, and ACP client adapters. band_terminal = True remains shorthand for TurnEffect.ACT.
    • Connection Conflict Policy — AgentConfig.conflict_policy takes ConflictPolicy.SUPERSEDE (default) or ConflictPolicy.REJECT. With REJECT, the platform refuses a second connection for an agent that is already connected, and the SDK raises AgentAlreadyRunningError.
    • ACP emit Support — ACPClientAdapter, CopilotACPAdapter, CursorACPAdapter, and OmpACPAdapter accept emit with Emit.TOOL_CALLS, Emit.THOUGHTS, and Emit.TASK_EVENTS. Omitting emit posts all three.
    • Copilot ACP Model and Reasoning Effort — CopilotACPAdapterConfig.model and reasoning_effort select the session’s model and effort. A value the session does not advertise fails the turn with an error listing the advertised values.
    • OMP Model and API Key — OmpACPAdapterConfig.model (provider-qualified, for example openai/gpt-5.4-mini) is passed to OMP as --model. api_key is passed in that provider’s env var; setting it without model raises ValueError.
    • OMP yolo Approval Mode — OmpACPAdapterConfig.approval_mode accepts "always-ask" (default) or "yolo".
    • OMP and Copilot ACP Turn Timeout — OmpACPAdapterConfig.turn_timeout_s and CopilotACPAdapterConfig.turn_timeout_s set the per-turn timeout (default 300 seconds).
    • Claude Code Launch Options — ClaudeSDKAdapter(cli=ClaudeCLIOptions(...)) sets cli_path, plugin_dirs, add_dirs, env, and extra_args for the Claude CLI. extra_args that name an adapter-owned flag are rejected.
    • Claude Permission Modes — permission_mode accepts "dontAsk" and "auto". Combining "dontAsk" with any approval_mode raises ValueError.
    • Codex Skill Roots — CodexAdapterConfig.skill_roots (absolute paths, or CODEX_SKILL_ROOTS as a JSON list) registers extra Codex skill directories.
    • Python 3.13 — band-sdk supports Python 3.11 through 3.13.

Changed

  • Python SDK:
    • OMP Example Default Model — The bundled OMP example now defaults to openai/gpt-5.4-mini (previously google/gemini-2.5-flash) and needs OPENAI_API_KEY. Set model and the matching provider key on OmpACPAdapterConfig to use another model.

Python SDK: Removed and Renamed APIs

One adapter keyword and a few adapter-author helpers were removed or renamed.

Before (3.2.x)After (3.3.0)
OmpACPAdapter(config, turn_timeout_s=...)OmpACPAdapter(OmpACPAdapterConfig(turn_timeout_s=...))
CopilotACPAdapter(config, turn_timeout_s=...)CopilotACPAdapter(CopilotACPAdapterConfig(turn_timeout_s=...))
band.runtime.tools.is_room_posting_tool, ROOM_POSTING_TOOL_NAMES, REPLY_SETTLING_TOOL_NAMESband.runtime.tools.settles_turn_reply
is_terminal_success(custom_terminal=...)is_terminal_success(custom_effects=...)
band.runtime.custom_tools.is_marked_terminalband.runtime.custom_tools.declared_effect
ClaudeSDKAdapter.PermissionModeclaude_agent_sdk.types.PermissionMode

What This Means

  • Most SDK users: no change.
  • OMP and Copilot ACP users passing turn_timeout_s= to the adapter: the keyword now raises TypeError; move it into the config.
  • Custom adapter authors: switch to the names in the right column. declared_effect returns TurnEffect | None instead of bool, and every TurnEffect is truthy, including OBSERVE. Replace if is_marked_terminal(tool): with a check on the effect’s did_work property, treating None as undeclared.

Migration

There is no deprecation period. Update call sites directly.

Fixed

  • Python SDK:
    • OMP Model Selection — A model chosen through the SDK now takes effect. Previously OMP ignored it and ran its own default.
    • Unreported Turn Failures — When a turn fails and the adapter has not reported it, the agent posts an error event to the room on the final retry. Turn this off with SessionConfig.report_turn_failures_to_room=False.
    • Band ACP Server Errors — Band errors, timeouts, room cleanup, and agent shutdown now fail the ACP client’s pending prompt with an error.
    • Codex Reasoning Effort — reasoning_effort accepts any effort the Codex CLI reports, such as max and ultra.
    • Letta Concurrent Starts — Letta adapters starting at the same time against one Letta server now share one organization and user.
    • Windows Room Workspaces — Codex and ACP adapters reject workspace_for_room paths without a drive letter, such as \workspace, instead of creating them on the current drive.