Skip to navigation

Python SDK 7.0.0

Added

  • Python SDK:
    • Native OMP Adapter — Connect an OMP agent directly to Band chat rooms with OmpAdapter, including per-room sessions, model selection, room-scoped MCP servers, and questions relayed to the room. The new omp extra installs only the adapter’s Python dependency (psutil); install the OMP CLI separately so the omp command is available.
    • Opt-In Queued Message Batching — Set SessionConfig.consume_all_queued to have an agent handle a backlog of queued messages together in one turn instead of one turn per message, up to max_queued_messages (1–100, default 10). It requires an adapter that declares supports_batch_input, and is not available with one-shot hosting (OneShotInvoker refuses it).
    • Room-Scoped MCP Servers for ACP Agents — ACP client adapters, including the Copilot and Cursor constructors, accept an optional resolve_mcp_servers callback. It receives the room’s workspace directory path once per session setup and returns that room’s external MCP servers, which replace the configured external servers while Band’s own MCP server stays in place.
    • Cloudflare One-Shot Agent Hosting — New example shows how to host a Python Band agent on Cloudflare while keeping its persistent event connection on your own infrastructure.
    • Antigravity Tool Recognition in ACP — The ACP base now recognizes Antigravity’s tool calls, so Band replies appear under the correct tool name with a single copy of their arguments.
    • Live Room Activity Detail — Rooms can now show what an agent is doing, such as reasoning, a named tool call, or waiting on a person, including Band tools and native Claude SDK, Codex, and OMP tools, approvals, and compaction.
  • Band Bridge:
    • HTTP Bridge Bearer Token — HTTP bridge targets can now be configured with a bearer_token, which the bridge sends as an Authorization: Bearer header on every forwarded request.

Python SDK: Loopback Band MCP Server Now Requires a Bearer Token

The loopback Band MCP server now refuses every request without a valid Authorization: Bearer <token> header, so MCP clients you wire up yourself must send it.

BeforeAfter
Requests to room mounts, multi-room endpoint, streamable HTTP, SSE, and SSE message POSTAccepted with no credentialsHTTP 401 without a valid bearer token
WebSocket upgradeAcceptedRejected; the client sees an HTTP 403 handshake rejection
/healthzOpenOpen (unchanged)
LocalMCPServer(...)auth_token not neededauth_token=... is required; LocalMCPServer.auth_headers returns the headers to send
create_band_mcp_backend(settings, ...)auth_token not neededauth_token=... is required (keyword-only)
BandMCPBackendendpoint() onlyendpoint() (unchanged) plus new headers
Claude SDK Band MCP headerNoneAuthorization: Bearer ${BAND_MCP_TOKEN}, with the token passed through the CLI environment
ClaudeCLIOptions.envCould set BAND_MCP_TOKENRejects BAND_MCP_TOKEN
OpenCode and Letta MCP registrationNo headersRegistered with the token headers

What This Means

  • New users: Nothing to do. Each adapter creates one token and the ACP, Claude SDK, OpenCode, and Letta integrations send it for you.
  • Existing users of the built-in adapters: Nothing to do, unless you set BAND_MCP_TOKEN in ClaudeCLIOptions.env, which is now rejected.
  • Custom MCP clients, LocalMCPServer and create_band_mcp_backend users: Pass auth_token when you construct the server or backend, and send the bearer header on every request.
  • Letta users: The token lives in the MCP row’s custom_headers, which anyone in the same Letta organization can read through the Letta API. It stops working when the process exits. A self-hosted row adopted at the same URL is now always rewritten.
  • Not covered: The token doesn’t protect against a process running as the same OS user, the published band-mcp CLI’s own transport, or an unauthenticated opencode serve.

Migration

  1. Upgrade to band-sdk 7.0.0.
  2. Remove BAND_MCP_TOKEN from any ClaudeCLIOptions.env you set.
  3. If you construct LocalMCPServer directly, pass auth_token=....
  4. If you call create_band_mcp_backend directly, pass auth_token=....
  5. If you call the server from your own MCP client, send Authorization: Bearer <token> using BandMCPBackend.headers, or LocalMCPServer.auth_headers when you own the server.
  6. If requests now return 401 or 403, check that the client sends the header the adapter generated.

Python SDK: Per-Room Session State and ACP Session Seeding

Claude SDK, Copilot SDK, and OpenCode now track one resumable session per room, and an ACP session belongs to a room only once its seeding prompt completes. Session records written by earlier versions are not resumed.

BeforeAfter
CopilotSDKSessionState.session_idOne session idRemoved; read the room’s session from room_to_session
ClaudeSDKSessionState.session_idOne session idReplaced by room_to_session, keyed by room id
Claude SDK resume recordsNo room idRequire claude_sdk_room_id
OpencodeSessionStatesession_id, mcp_server_name, room_id, created_atroom_to_session and session_registrations
OpenCode resume record keyopencode_session_idopencode_seeded_session_id
Emit.TASK_EVENTS on OpenCodeControlled whether the session was recordedStill accepted, no longer affects OpenCode
ACPClientAdapter._spawn_env_spawn_env(self)_spawn_env(self, room_id), so each room’s process can get its own environment
ACP prompt ending with stopReason: refusalNo refusal-specific handlingFails the turn with one room-visible failure carrying the agent’s text, whatever emit is set to, unless the turn already replied or declined; the agent process stays up
ACP session whose seeding prompt is refused, stopped, cancelled, raises, or times outCould become the room’s sessionDropped with no resume state; the next turn, recovery, or restart starts a new session with the room’s full context and transcript

What This Means

  • New users: Nothing to do.
  • Existing Claude SDK, Copilot SDK, and OpenCode rooms: After upgrading, each room starts one fresh session with its transcript replayed. For OpenCode, the old session stays on the OpenCode server.
  • ACP agents: A refused prompt on an already seeded or restored session keeps the session. A restart resumes the newest session whose seeding completed, and starts fresh with the transcript when the agent cannot load it. apply_model_selection on a room without a session keeps the selection for its next session; a model that session doesn’t offer fails that turn and the room reverts to the configured selection.

Migration

  1. Replace reads of state.session_id on CopilotSDKSessionState or ClaudeSDKSessionState with state.room_to_session.get(room_id).
  2. Replace reads of OpencodeSessionState.session_id, mcp_server_name, room_id, or created_at with room_to_session and session_registrations.
  3. If you read OpenCode resume records yourself, read opencode_seeded_session_id instead of opencode_session_id.
  4. If you subclass ACPClientAdapter and override _spawn_env, accept the room_id argument.
  5. If you relied on Emit.TASK_EVENTS to control OpenCode session recording, remove that assumption.

Band Bridge: Configuration Rejects Unknown Keys

This applies to the Band Bridge app shipped with this release, not the band-sdk package.

Bridge configuration models now reject unknown keys. A bridge config with a misspelled or stray key that was previously ignored now fails at startup with a validation error that does not echo the input. Remove or correct any unrecognized keys before upgrading.

Changed

  • Python SDK:
    • Live NOOA Thoughts — NOOA thoughts now post in the room as each model call completes, instead of after the whole turn ends.
    • Mention Guidance for Agents — Agents are now told consistently to use exact roster handles and to avoid repeating recipient labels in message content.
    • WebSocket Heartbeat Handling — WebSocket heartbeat timeouts are now handled by the Phoenix transport, which now requires >=0.4.1,<0.5, and the SDK’s band-sdk-core dependency moves from 2.8.0 to 6.1.1.

Fixed

  • Python SDK:
    • Working Indicator Lifetime — The working indicator now stays on while provider work continues behind a pending approval, and no longer turns on for housekeeping turns that show nothing to users.
    • OpenCode Turn Overlap — A new OpenCode message no longer starts a turn while the previous turn is still finishing its reply.
    • OpenCode Session Resume — OpenCode no longer resumes a session whose first prompt failed, and now replays the room’s history into a fresh session.
    • Claude SDK Session Resume — The Claude SDK adapter no longer resumes a session whose seeding turn errored, and replays the room’s history when it needs to.
    • Copilot SDK Session Resume — The Copilot SDK adapter no longer resumes a session whose first prompt failed, and a fresh session no longer overwrites a room’s earlier native state.
    • Shutdown Retries — Retrying a shutdown no longer cancels an accepted turn’s cleanup a second time or reports retirement before it finishes.
    • OMP Stalled Turns — Native OMP turns no longer stay open indefinitely after a lost completion; they now fail with OmpCompletionTimeout.
    • OMP Process Cleanup — OMP cleanup no longer risks killing an unrelated process that reused a process ID, and overlapping permission prompts no longer clear each other’s activity.
    • Tool Call Redaction — Tool-call events with file content containing lone surrogate characters are now redacted and delivered instead of being lost.
    • Oversized Integer Tool Payloads — A Band tool call with an oversized integer payload is now refused under the tool’s own name instead of failing the turn.
  • Band Bridge:
    • Bridge Rehydration Cancellation — Cancelling one room’s startup during backlog rehydration no longer shuts down the whole bridge.

Security

  • Python SDK:
    • Loopback Band MCP Server Authentication — See the bearer-token breaking change above.