Coding Agent Adapters
These adapters run a coding agent, usually one local process per room, and serve Band’s tools to it over MCP or the agent’s own tool protocol. They share two mechanisms, room workspaces and room retention, described first. Every adapter follows the shared adapter construction rules and takes the feature keywords.
Room Workspaces
ClaudeSDKAdapter, CodexAdapter, and the ACP client adapters (ACPClientAdapter, CopilotACPAdapter, CursorACPAdapter, OmpACPAdapter) give each room its own workspace directory. The workspace comes from workspace_for_room(room_id), which must return an absolute path. Without a resolver, the SDK creates .band-workspaces/<room_id> under the process working directory.
create_room_workspace_resolver(root) creates <root>/<room_id> on first use and rejects a room ID that would escape root with ValueError: room id cannot escape the workspace root. A resolver that returns a relative path raises ValueError: workspace_for_room must return an absolute path when a room is first resolved, and one that hands the same directory to two rooms raises ValueError: workspace_for_room assigned '<path>' to both '<room>' and '<room>'.
To keep the isolation guarantee, Codex and the ACP adapters reject transports that share one process across rooms:
ACPClientAdapterConfig and its presets accept cwd as a root and turn it into one child directory per room. ClaudeSDKAdapterConfig.cwd is different: it names one existing directory that every room shares, which is the pre-5.0.0 behavior; omit it for isolated room workspaces. On both, setting cwd together with the adapter’s workspace_for_room argument raises ValueError: set either cwd or workspace_for_room, not both.
Room Retention
ClaudeSDKAdapterConfig, CodexAdapterConfig, and the ACP client configs carry a retention: RoomRetentionConfig field, from band.core.retention.config, with idle_timeout_s: float | None = None and transition_timeout_s: float. idle_timeout_s must be greater than 0 when set, and transition_timeout_s bounds how long a caller waits for one room acquisition or cleanup to report its result, after which the unfinished step stays owned for a retry. The config defaults transition_timeout_s to 60.0 for ClaudeSDKAdapterConfig and CodexAdapterConfig, and 30.0 for the ACP client configs; a bare RoomRetentionConfig() uses 10.0. The field is the gate for an adapter-owned room retention lifecycle that no shipped adapter enables yet: as of band-sdk 6.0.1 every provider rejects a non-None idle_timeout_s at config construction, because none can prove that a disconnect would not cancel the agent’s asynchronous work. The error names the provider, for example Codex idle retention is unavailable: native idle and terminal state do not account for asynchronous hooks and delegated work; shutdown can cancel that work. Leave retention.idle_timeout_s unset. Leave the field at its default.
ClaudeSDKAdapter
Adapter for the Claude Agent SDK, with Band tools served to Claude Code over a room-bound MCP endpoint.
ClaudeApprovalOptions holds the room approval settings. Band’s own tools are never gated.
An invalid combination raises ValidationError at config construction, for example permission_mode='dontAsk' denies tool calls without consulting approvals; set approvals=None or approvals.wait_timeout_s must be less than turn_timeout_s, or the turn times out before the approval does.
Emits TOOL_CALLS, THOUGHTS, and USAGE. See Approval Mode for the room approval flow and Claude Agent SDK for a worked example.
CodexAdapter
Adapter for the OpenAI Codex app-server over JSON-RPC. It runs one stdio Codex process per room; see Room Workspaces.
client_factory must stay unset: any value raises ValueError. Room replies come only from Band tools: Codex’s native assistant text is posted as thought telemetry when Emit.THOUGHTS is on and never counts as the reply, so a turn that answers only in native text reaches the missing-reply verdict described in Turn Outcome. Emits all four kinds.
CodexAdapterConfig
CodexAdapterConfig has 44 fields and is a pydantic-settings model: every field can be set as a constructor argument or through a CODEX_-prefixed environment variable, and a constructor argument always wins. The table lists the most used; the full list is in codex.py at band-sdk-v6.0.1.
fallback_send_agent_text and assistant_text_mode were removed in 5.0.0; passing either raises ValidationError (Extra inputs are not permitted), and CODEX_FALLBACK_SEND_AGENT_TEXT and CODEX_ASSISTANT_TEXT_MODE are no longer read. CODEX_CWD is ignored, because cwd is rejected. See Codex for a worked example.
OpencodeAdapter
Bridges each room to a session on an OpenCode HTTP server and serves Band tools to it over an in-process MCP server shared by all rooms.
The adapter talks to one OpenCode server, http://127.0.0.1:4096 by default, and creates one session per room. Emits TOOL_CALLS, TASK_EVENTS, and USAGE.
OpencodeAdapterConfig
OpencodeAdapterConfig is a pydantic-settings model with the OPENCODE_ environment prefix; a constructor argument always wins.
See OpenCode for a worked example.
CopilotSDKAdapter
Maps each room to a persistent GitHub Copilot SDK session. Copilot’s built-in shell and file tools are disabled; the model sees Band tools and your additional_tools.
CopilotSDKAdapterConfig
Emits TOOL_CALLS, THOUGHTS, and USAGE. The adapter still posts the model’s final text as the reply when no Band tool replied. See GitHub Copilot for a worked example.
ACPClientAdapter
Bridges each room to an external ACP agent process, one stdio subprocess per room.
host and port in the config and spawn_process in the constructor raise ValueError when set; see Room Workspaces. With emit unset, the adapter posts thoughts, tool calls, and plan updates from the ACP session-update stream into the room; see What Each Adapter Supports. Room replies come only from Band tools: native agent text is thought telemetry, and a turn that ends without a band_send_message or band_no_reply call reaches the missing-reply verdict in Turn Outcome. The retired assistant_text_mode field raises Extra inputs are not permitted.
See ACP Client Adapter for a worked example.
ACP Presets
CopilotACPAdapter, CursorACPAdapter, and OmpACPAdapter are ACPClientAdapter presets for one runtime each. Their configs subclass ACPClientAdapterConfig and add the runtime’s own settings.
Every preset config inherits env, cwd, mcp_servers, inject_band_tools, custom_section, turn_timeout_s, turn_settle_timeout_s, model, reasoning_effort, and retention from ACPClientAdapterConfig. workspace_for_room and resolve_session_config are adapter arguments. See GitHub Copilot CLI and Cursor for worked examples.