bma.executor.v1.1 outside the capability requests, with its direction, parameters and result, and how each SDK sends or serves it. Most are handled by the SDK itself (registration, heartbeats, token refresh, tool dispatch); the rest map to the typed methods on the other pages.
Generated from bma-executor-sdk 1.12.2 and its contract (
contracts/bma/executor, protocol bma.executor.v1.1). Install, credentials and quick starts are on the bma-executor-sdk overview; the protocol itself is described in Executor Protocol.Methods
screen.start
Start a native WebRTC screen producer. Starts a single native screen relay for this machine; no shell or virtual desktop is created. The server-selected session is idempotent; another active session is rejected. The relay ticket must never be logged. Human input remains disabled until separately fenced and authorized. Direction: harness → executor · Kind:request · Capability: display.native_webrtc · Idempotent by: session_id · Since: bma.executor.v1.1
Parameters
Result
ScreenStartResult
In the SDK
screen.stop
Stop a native screen session. Fences human input and stops the named native screen producer, waiting for cleanup before returning. Never resumes an agent. A repeated stop is safe; it must not affect a replacement session. Direction: harness → executor · Kind:request · Capability: display.native_webrtc · Idempotent by: session_id · Since: bma.executor.v1.1
Parameters
Result
ScreenStopResult
In the SDK
executor.register
Register an executor connection. Executor to harness request, the first frame on the control channel. protocol MUST equal the negotiated WebSocket subprotocol; otherwise the server answers -32010 and closes with 4003. A machine-scoped executor sends an empty environment_id. resume.active_sessions reattaches sessions after reconnect. A machine-scoped executor that declares neither capabilities.process nor capabilities.agent is answered -32012 with data.reason “capability_missing” and data.capability “process” instead of a result; no runtime is bound and the connection stays unregistered. Direction: executor → harness · Kind:request · Since: bma.executor.v1
Parameters
Result
ExecutorRegisterResult
In the SDK
Handled by the SDK: sent by
start, with the capabilities and the resume id after a reconnect. (executor)
executor.heartbeat
Refresh the executor lease. Executor to harness request, sent every heartbeat_interval_ms. Two missed heartbeats expire the lease server-side. drain=true means the executor must stop accepting new sessions and finish current work. Direction: executor → harness · Kind:request · Since: bma.executor.v1
Parameters
Result
ExecutorHeartbeatResult
In the SDK
Handled by the SDK: sent by the client at the interval
executor.register returns. (executor)
executor.token.refresh
Extend the connection with a fresh executor token. Executor to harness request. Before the current token expires the executor fetches a new one from POST /v1/machines/{machine_id}/token or POST /v1/environments/{environment_id}/token (legacy alias POST /v1/executors/token) with its original credential and sends it on the open control channel. The harness verifies that it names the same executor, scope and machine credential as the connection and moves the connection’s 4001 deadline to the new token’s expiry; nothing else about the connection changes. A rejected token leaves the old deadline in place. A harness without the method answers -32601; the executor then keeps reconnecting on 4001. Direction: executor → harness · Kind:request · Since: bma.executor.v1.1
Parameters
Result
ExecutorTokenRefreshResult
In the SDK
Handled by the SDK: the client fetches a fresh executor token and extends the connection before it expires. (executor)
executor.capabilities.update
Publish changed executor capabilities. Executor to harness notification. It may change capabilities, not the protocol version. Direction: executor → harness · Kind:notification · Since: bma.executor.v1
Parameters
Result
No result (notification).
In the SDK
executor.drain
Ask the executor to drain. Harness to executor request. The executor stops accepting new sessions, finishes current work, and reports active_sessions. Direction: harness → executor · Kind:request · Since: bma.executor.v1
Parameters
Result
ExecutorDrainResult
In the SDK
Handled by the SDK: served with
onDrain; sent by the harness drain. (executor)
executor.close
Close the executor connection. Either side notification, followed by WebSocket close code 1000 or 1001. Direction: both directions · Kind:notification · Since: bma.executor.v1
Parameters
Result
No result (notification).
In the SDK
Handled by the SDK: sent by
stop; received, it stops the client for good. (executor)
session.assign
Assign a session to the executor. Harness to executor request. The executor rejects a session that exceeds its capability or resource limits with -32009. metadata.source “harness” marks a long-lived harness session; any other source is one-shot and ends after its tool call. Direction: harness → executor · Kind:request · Since: bma.executor.v1
Parameters
Result
SessionAssignResult
In the SDK
Handled by the SDK: served with
onSessionAssign (or the Go Core); sent by the harness assignSession. (executor)
session.ready
Report a session ready. Executor to harness request after session.assign is accepted. Direction: executor → harness · Kind:request · Since: bma.executor.v1
Parameters
Result
Ack
In the SDK
session.event
Emit a durable session event. Executor to harness request for durable session events. A tool executor’s event is idempotent by its JSON-RPC id. An agent executor (capability agent) also sends turn_id, event_id and sequence; the harness deduplicates by (session_id, event_id), accepts a sequence at or below acked_sequence as a duplicate, and rejects a gap with -32013 conflict (data.expected_sequence). An agent event matches schemas/agent.json AgentEvent. The JSON-RPC response is the ACK; the executor keeps every unacked event and resends them in sequence order after reconnect, before any new event. Contract 1.7.0 clarifies two rules that keep a session from stalling. A failure on the harness side that resending can fix (storage conflict or outage) is answered with data.retryable true and the executor resends the same event; only a rejection of the event itself (invalid params) is permanent, and it ends the turn; the executor sends session.error (bma_error_code event_rejected) and session.status_idle for the turn in place of the rejected event, renumbers from data.expected_sequence only so that this session.error is accepted, and never continues the turn. Direction: executor → harness · Kind:request · Idempotent by: jsonrpc_id · Since: bma.executor.v1
Parameters
Result
SessionEventResult
In the SDK
session.status
Report session status. Executor to harness notification. detail carries free-form context such as tool_running or mcp_unavailable. Direction: executor → harness · Kind:notification · Since: bma.executor.v1
Parameters
Result
No result (notification).
In the SDK
session.stop
Stop a session. Harness to executor request. The executor terminates every process and MCP server of the session (SIGTERM, then SIGKILL) and then sends session.ended. Direction: harness → executor · Kind:request · Since: bma.executor.v1
Parameters
Result
SessionStopResult
In the SDK
Handled by the SDK: served with
onSessionStop (or the Go Core); sent by the harness session stop. (executor)
session.ended
Report a session ended. Executor to harness request, sent after every process of the session is gone. Retried until accepted. Direction: executor → harness · Kind:request · Since: bma.executor.v1
Parameters
Result
Ack
In the SDK
tool.call
Dispatch a tool call. Harness to executor request. The executor acknowledges the dispatch and reports the outcome separately with tool.result. A duplicate tool_call_id is acknowledged without re-execution. A tool the executor does not serve is -32012 with data.capability “tool:<name>”. Direction: harness → executor · Kind:request · Since: bma.executor.v1
Parameters
Result
Ack
In the SDK
Handled by the SDK: served by the typed tool slots
client.tools.<name>.handle; sent by the harness callTool / session.tools.<name>.call. (tools)
tool.result
Report a tool result. Executor to harness request, idempotent by tool_call_id and retried until accepted. Large output is uploaded first (POST /v1/environments/{environment_id}/artifacts; legacy alias POST /v1/executors/artifacts) and referenced by an artifact content block. Direction: executor → harness · Kind:request · Idempotent by: tool_call_id · Since: bma.executor.v1
Parameters
Result
Ack
In the SDK
tool.cancel
Cancel a running tool call. Harness to executor request. The executor kills the process group; canceled=false when the call is unknown or already finished. Direction: harness → executor · Kind:request · Since: bma.executor.v1
Parameters
Result
ToolCancelResult
In the SDK
Handled by the SDK: aborts the running handler (its signal or context); sent by the harness
cancelTool. (tools)
tool.progress
Report tool progress. Executor to harness notification, optional. Direction: executor → harness · Kind:notification · Since: bma.executor.v1
Parameters
Result
No result (notification).
In the SDK
desktop.attach
Attach a desktop session to the machine’s running desktop. Harness to executor request (machine-scoped executors that claim display.desktop). The machine’s desktop agent runs from machine start (desktop-relay.md §1); the executor hands it the session and answers once the agent accepted it. The agent then dials the session’s relay lanes at relay_url with the ticket (Authorization bearer) and serves the session until it is closed (session_close, or a lane refused with 4001/4003/4004) or attached again, which replaces the earlier attach. width and height, together, resize the desktop unless the same size was asked for last. wallpaper names the environment’s default wallpaper; the result asks for its bytes (desktop.wallpaper) when the machine lacks them. Waits at most 5 s for a desktop that is still starting, then answers ResourceUnavailable with data.reason desktop_starting and data.retryable true (the platform answers 409 machine_starting stage=desktop_starting with Retry-After). With capture_id, attach only the media relay of that already running screen_live capture on machine_id; session_id remains the desktop relay session. This requires an exact active machine/capture match and forbids width, height and wallpaper. It never starts a capture, the legacy peer-to-peer path or another input worker, and a missing capture is rejected. Direction: harness → executor · Kind:request · Capability: display.desktop · Idempotent by: session_id · Since: bma.executor.v1.1
Parameters
Result
DesktopAttachResult
In the SDK
desktop.wallpaper
Send one chunk of the default wallpaper a desktop.attach asked for. Harness to executor request. Chunks follow each other from offset 0 (data is standard base64, at most max_process_write_bytes decoded); the chunk with done installs the image when its sha256 matches and applies it to the running desktop. Direction: harness → executor · Kind:request · Capability: display.desktop · Since: bma.executor.v1.1
Parameters
Result
DesktopWallpaperResult
In the SDK
fs.mount
Mount session file views backed by bma-file. Harness to executor request (machine-scoped). The executor mounts each listed view at its path as a FUSE file system that reads from service_url with the view’s token, and keeps the token in memory only. Idempotent by (session_id, view), so resending the same mounts with new tokens renews the tokens without remounting; a changed path or readonly remounts. Sent when the session is bound to the machine and again after a resume or reconnect, because tokens are bound to the binding epoch. Sessions are independent, so a request for one session never changes the mounts of another, and fs.unmount ends one session only. An executor that declared fs.skills_per_session receives the skills view of each session at its own path (<session_files.root>/<agent_session_id>/skills, root /mnt/session when it declared none) and removes the mount points it created on fs.unmount; any other executor receives no skills view (there is no machine-wide skills path). Since contract 1.18.0 an executor that declared fs.copy_views (and a session_files.root) also receives fs.mount, for those views only, at <root>/<agent_session_id>/<view>; it copies the view as read-only files through the bma-file read routes instead of mounting it (see FsCapability.copy_views and file.json). Direction: harness → executor · Kind:request · Capability: fs.fuse · Idempotent by: session_id+view · Since: bma.executor.v1.1
Parameters
Result
FsMountResult
In the SDK
fs.unmount
Unmount the session file views. Harness to executor request (machine-scoped). Unmounts every view of the session and drops its tokens. With flush the executor first commits pending writes (none for read-only views). Idempotent by session_id, a session with nothing mounted answers “unmounted”. For a view placed by copying (fs.copy_views) the executor deletes that session’s copied directory. Direction: harness → executor · Kind:request · Capability: fs.fuse · Idempotent by: session_id · Since: bma.executor.v1.1
Parameters
Result
FsUnmountResult
In the SDK
session_files.flush
Upload the session outputs written so far and wait for the uploads. Harness to executor request (machine-scoped, contract 1.13.0). Before the platform pauses or hibernates the machine it asks the executor to upload every changed file under the outputs of every session it shows (what the periodic scan would upload next, without waiting for the file to be seen stable) and answers when all uploads are done. “flushed” means no upload is outstanding; “failed” means at least one upload failed and may be retried, so the platform must not pause yet. A file the platform refuses for good (size, quota, name) is not a failure. Idempotent; an executor that does not know the method answers -32601, which the platform treats as nothing to flush. Direction: harness → executor · Kind:request · Capability: session_files · Since: bma.executor.v1.1
Result
SessionFilesFlushResult
In the SDK
turn.start
Start an agent turn. Harness to executor request (capability agent). Opens the agent session on first use (no session.assign) or continues it; executor_session_ref from an earlier TurnStartResult lets the executor resume its local conversation after a restart. The executor answers as soon as the turn is accepted and reports progress with session.event. Idempotent by turn_id. A session with a running turn answers -32013 conflict (use turn.input); a turn.start while max_sessions turns are running answers -32009 (an idle session holds no slot). A request that would serialize to more than 48 KiB carries a single input_ref block as its input (contract 1.7.0, only to an executor that declared agent.input_by_reference). Direction: harness → executor · Kind:request · Capability: agent · Idempotent by: turn_id · Since: bma.executor.v1.1
Parameters
Result
TurnStartResult
In the SDK
Handled by the SDK: served by
serveAgent (openTurn, then runTurn); sent by the harness startTurn. (agent)
turn.input
Add user input to the running turn. Harness to executor request (capability agent). The local agent consumes the input at its next step (contract 1.25.0, agent.steering - at the running turn’s next step boundary, before its next model request; without it after the running prompt ends). Idempotent by input_id. When turn_id is not the running turn the executor answers -32013 conflict and the harness starts a new turn instead. A request that would serialize to more than 48 KiB carries a single input_ref block as its input (contract 1.7.0, only to an executor that declared agent.input_by_reference). Direction: harness → executor · Kind:request · Capability: agent · Idempotent by: input_id · Since: bma.executor.v1.1
Parameters
Result
Ack
In the SDK
Handled by the SDK: delivered to the running turn’s inputs; sent by the harness
sendTurnInput. (agent)
turn.cancel
Stop the running turn. Harness to executor request (capability agent). The executor stops the agent loop, cancels its local tool calls, withdraws open interactions (interaction.cancel turn_canceled), and ends the turn with session.status_idle turn_outcome=canceled. The session stays open for the next turn.start. Unlike tool.cancel (one harness-dispatched tool call) and session.stop (a hand session and its processes), it targets only the agent turn. Direction: harness → executor · Kind:request · Capability: agent · Since: bma.executor.v1.1
Parameters
Result
TurnCancelResult
In the SDK
Handled by the SDK: cancels
runTurn; sent by the harness cancelTurn. (agent)
session.compact
Compact an idle agent context without sending a turn. Explicit idle-session maintenance. The platform reserves the session against new inputs, pending decisions and automatic continuations before calling. The executor independently rejects an active turn, pending interactions or another maintenance operation. It keeps the original transcript, compacts an isolated durable context and atomically publishes its pointer and immutable receipt only after success. Failed or cancelled preparation preserves the old context. Unknown publication is reconciled with the same operation_id and expected version, never a fresh id. Metadata contains maintenance-only platform credentials, not a historical turn token. No tool may run during summarization. Older handlers explicitly refuse this method. Direction: harness → executor · Kind:request · Capability: agent.context_maintenance · Idempotent by: operation_id · Since: bma.executor.v1.1
Parameters
Result
SessionCompactResult
In the SDK
session.compact_cancel
Request cancellation of one context maintenance operation. Durably fences publication of the exact operation or returns its already-applied receipt. It never closes the conversation or cancels an ordinary turn. canceled=true means the operation cannot publish, including a late retry; settled=false means its SDK reservation still belongs to work that has not settled. The platform retains its admission barrier until settled=true, and reconciles uncertain replies by repeating this exact cancel request. Direction: harness → executor · Kind:request · Capability: agent.context_maintenance · Since: bma.executor.v1.1
Parameters
Result
SessionCompactCancelResult
In the SDK
session.close
Close an agent session. Harness to executor request (capability agent). The executor cancels a running turn as turn.cancel does, waits until its events are acknowledged, releases the local conversation, and then sends session.ended. closed=false for an unknown session. A later turn.start with the same session_id starts a new local conversation. Direction: harness → executor · Kind:request · Capability: agent · Since: bma.executor.v1.1
Parameters
Result
SessionCloseResult
In the SDK
Handled by the SDK: served by
serveAgent (closeSession); sent by the harness closeAgentSession. (agent)
session.event_delta
Stream a preview of a durable agent event. Executor to harness notification (capability agent). Transient and lossy; never acknowledged or resent. event_id is the event_id of the durable session.event that finalizes the preview. The harness relays it to subscribers as Anthropic event_start and event_delta. Direction: executor → harness · Kind:notification · Capability: agent · Since: bma.executor.v1.1
Parameters
Result
No result (notification).
In the SDK
session.history
Read the conversation of a session before a turn. Executor to harness request (capability agent, contract 1.15.0). The executor that is the session’s brain (the target the session’s turns are dispatched to) reads the session’s conversation as the platform’s event log keeps it, the single source of truth of a session: the durable events before the opening input of the given running turn, a page at a time in log order (has_more says more follow). Only the conversation travels: user.message, agent.message, agent.tool_use, agent.tool_result, agent.custom_tool_use, user.custom_tool_result, agent.mcp_tool_use and agent.mcp_tool_result, each with its bma_sequence, id, type and official body. To an executor that declared agent.input_by_reference a user.message whose body is over 48 KiB carries its content as a single input_ref block (contract 1.7.0) whose input_id is the event’s id: the inputs endpoint answers the message’s content blocks. A brain calls it when it opens a session it holds no local state for although the session has a past, for example a session whose earlier turns ran on another brain (data migration from another stack) or whose state was lost; it rebuilds its context from the events, replaying messages, tool calls and their results in its model’s format under its usual context limits, and answers the turn.start with context_rebuilt true. Only the session’s brain may read it: any other connection gets forbidden (-32001), before any turn of the session was dispatched not_dispatched (-32013, retryable); a turn that is not open is session_not_active (-32007); an unknown or deleted session is session_not_found (-32002). A harness without the method answers -32601; the brain then has no history to rebuild from. Direction: executor → harness · Kind:request · Capability: agent · Since: bma.executor.v1.1
Parameters
Result
SessionHistoryResult
In the SDK
interaction.request
Ask the platform for an approval or an answer. Executor to harness request (capability agent). The harness opens one platform agent interaction (the same request on desktop, mobile and integrations) and answers with interaction.response later. Idempotent by interaction_id. A permission request references the agent.tool_use event in tool_use_id, sent earlier with evaluated_permission ask. The executor keeps local authority; it may still deny, and it treats expires_at as a local deny. An interaction_id of the form appr_ plus 24 lower-case hex digits (the deterministic approval id) is adopted as the platform interaction id; the interactions API, its card and the session stream use it, platform_interaction_id equals it, and a repeat of it (after an executor restart too) names the same interaction, never a second card. The same id for another tool_use_id (within one executor epoch) or another kind is refused with error conflict (-32013) and the stored interaction is left unchanged. An interaction_id of any other form is only the executor’s key; the platform assigns its own id (int_…) and returns it. Direction: executor → harness · Kind:request · Capability: agent · Idempotent by: interaction_id · Since: bma.executor.v1.1
Parameters
Result
InteractionRequestResult
In the SDK
interaction.response
Deliver the answer to an interaction. Harness to executor request (capability agent). Sent once the platform interaction resolves, expires or is canceled; retried with the same interaction_id until answered. The first answer wins; a repeat or an unknown interaction answers accepted=false. Direction: harness → executor · Kind:request · Capability: agent · Idempotent by: interaction_id · Since: bma.executor.v1.1
Parameters
Result
InteractionResponseResult
In the SDK
Handled by the SDK: resolves the waiting
requestInteraction; sent by the harness respondInteraction. (agent)
agent.custom_tool_result
Deliver the user’s result of a custom tool call. Harness to executor request (capability agent; sent only to an executor that declared agent.custom_tools). The executor emitted agent.custom_tool_use (its event_id is the tool_use_id) and waits; the platform sends the result the user’s application submitted with user.custom_tool_result. Only the first result of a call counts: the platform accepts one per tool_use_id and the executor answers a repeat, an unknown tool_use_id or a call it no longer waits for with accepted=false. Idempotent by tool_use_id: the platform retries the same result until the executor answers, also on a new connection. Timeout: the executor owns the wait. When its own limit passes it ends the call with a failed agent.tool_result (tool_use_id of the call, is_error true), continues the turn, and answers a later result with accepted=false; the platform stops accepting results for that call. Cancel: turn.cancel ends the waiting call as canceled with the turn, and the platform drops results it has not delivered yet for a turn that ended. Direction: harness → executor · Kind:request · Capability: agent · Idempotent by: tool_use_id · Since: bma.executor.v1.1
Parameters
Result
CustomToolResultResult
In the SDK
interaction.cancel
Withdraw an open interaction. Executor to harness request (capability agent). The executor no longer needs the answer, for example the user answered in the local UI (resolved_locally) or the turn was canceled. The harness cancels the platform interaction so every client dismisses it. Idempotent by interaction_id. Direction: executor → harness · Kind:request · Capability: agent · Idempotent by: interaction_id · Since: bma.executor.v1.1
Parameters
Result
Ack
In the SDK
model_token.refresh
Fetch a fresh model token for a running turn. Executor to harness request (capability agent). A brain started by turn.start with a model credential (metadata model_token, valid 1 hour) calls it before the token expires (the reference executors do so when less than 10 minutes remain) and joins model_base_url with the new model_token for its next model calls; the old token stays valid until it expires. The platform signs a new token only while the turn is active (pending, running or rescheduling) and the turn belongs to a session routed to this executor’s machine, so a turn that ended, was canceled or failed gets no further tokens: this is how the platform revokes model access per turn (a token already issued runs out its own expiry). Each call returns a new token; calls are not idempotent and a repeat is harmless. Errors carry data.reason: turn_inactive (-32007: the turn is not active), forbidden (-32001: the session or turn is unknown, belongs to another executor, or this executor is not entitled to platform credentials), model_token_unavailable (-32012: the platform issues no such token). A harness without the method answers -32601; the executor then keeps the token it has. Direction: executor → harness · Kind:request · Capability: agent · Since: bma.executor.v1.1
Parameters
Result
ModelTokenRefreshResult
In the SDK
tools_token.refresh
Fetch a fresh platform tools token for a running turn. Executor to harness request (capability agent, contract 1.4.0). A brain started by turn.start with a platform tools credential (metadata tools_mcp_token, valid 1 hour, handed over only when the session’s brain machine and hands machine differ) calls it before the token expires (the reference executors do so when less than 10 minutes remain) and uses the new tools_mcp_token with tools_mcp_url for its next tool calls; the old token stays valid until it expires or its epoch is superseded. The shape and rules are those of model_token.refresh: the platform signs a new token only while the turn is active (pending, running or rescheduling), the turn belongs to a session routed to this executor’s machine as the brain machine, and the call comes from the turn’s current epoch, so a turn that ended, was canceled or failed, or was started again in a newer epoch gets no further token for the old epoch. Each call returns a new token; calls are not idempotent and a repeat is harmless. Errors carry data.reason: turn_inactive (-32007: the turn is not active), forbidden (-32001: the session or turn is unknown, belongs to another executor, or this executor is not entitled to brain_tools), tools_token_unavailable (-32012: the platform issues no such token for this turn, for example brain and hands are one machine). A harness without the method answers -32601; the executor then keeps the token it has. Direction: executor → harness · Kind:request · Capability: agent · Since: bma.executor.v1.1
Parameters
Result
ToolsTokenRefreshResult
In the SDK
working_log.read
Read a page of the session’s working log. Executor to harness request (capability agent, contract 1.22.0, ADR-0083). The executor that is the session’s brain (the target the session’s turns are dispatched to) reads the working log it keeps on the platform: its entries after the given sequence, in order, a page at a time (has_more says that more follow), and the highest local sequence the platform has acknowledged. An executor reads it when it opens a session it holds no copy of, for example after another instance of its brain fleet ran the session’s earlier turns. Only the session’s brain may read it: any other connection gets forbidden (-32001), and before any turn of the session was dispatched not_dispatched (-32013, retryable). An unknown or deleted session is session_not_found (-32002). Direction: executor → harness · Kind:request · Capability: agent · Since: bma.executor.v1.1
Parameters
Result
WorkingLogReadResult
In the SDK
working_log.append
Append entries to the session’s working log. Executor to harness request (capability agent, contract 1.22.0, ADR-0083). The session’s brain appends entries to the working log it keeps on the platform; the answer means they are stored. An entry whose key the log already has is skipped, so a repeated append is harmless; the entries of one call are stored together or not at all, at most 500 per call. acked_sequence moves the platform’s record of the highest acknowledged local sequence up (never down, never beyond the log). The same refusals as working_log.read apply; a refused append means the executor is no longer the session’s brain and must stop the session’s turn. Invalid entries (no type, a payload that is not an object, too many) and an acked_sequence beyond the log are invalid_params with data.reason invalid_entry, batch_too_large or acked_beyond_log. Direction: executor → harness · Kind:request · Capability: agent · Since: bma.executor.v1.1
Parameters
Result
WorkingLogAppendResult
In the SDK