Skip to content

Control Protocol (OCP)

OCP Method Reference

All 42 methods in protocol: 1. See Control Protocol for framing, transports and the handshake.

Every method is answered by this build. Four are gated behind --allow-host-mutations and answer unsupported without it.

Scope describes blast radius: connection affects this connection, session affects this conversation, host affects the machine.

Handshake

MethodScopePurpose
helloconnectionBegin the connection. Returns the protocol version and features[], the methods this build answers. The only method accepted before the handshake

Sessions

MethodScopePurpose
session.createhostCreate a conversation, or continue a saved one
session.attachsessionAttach to the live event stream. Takes fromSeq
session.detachsessionDetach without ending the session
session.listhostList saved conversations
session.closesessionEnd the session
session.infosessionCurrent state of this session

There is no session.resume

Continuing a saved conversation is session.create with a prior session id. Use session.list to find one.

Reading

MethodScopePurpose
session.pollsessionCursor pattern. {fromSeq, waitMs} → events plus nextSeq. waitMs: 0 is a plain poll; waitMs > 0 parks until an event arrives or the deadline passes
transcript.getsessionRead the conversation transcript. Pages, rather than risking frame_too_large on a long history

There is no transcript.edit. History is append-only, and compaction is its only sanctioned mutation.

Turns

MethodScopePurpose
turn.sendsessionSend a user message into the conversation. Accepts an idempotencyKey, echoed on turn_started, so a client that retried after a timeout can tell its own turn from a duplicate
turn.queuesessionQueue a message to become the next prompt when the current turn ends
turn.cancelsessionCancel the running turn. The session stays alive
MethodScopePurpose
permission.respondsessionAnswer a permission.required frame
permission.setModesessionChange the permission mode mid-session
elicitation.respondsessionAnswer an elicitation.required frame, where the agent asked a question

permission.respond takes one of:

VerdictEffect
allow_onceApprove this call
allow_alwaysApprove this call and stop asking for its shape
reject_onceRefuse this call
reject_alwaysRefuse this call and stop asking

permission.setMode accepts plan, manual, accept_edits, auto or dangerous. See Permission Model.

Hard-stop tools always ask

A permission.required frame carrying tier hard_stop is raised in every mode, including dangerous. A client cannot pre-approve it, and neither can permission.setMode.

Plan mode

MethodScopePurpose
plan.listsessionThe model's current plan items
plan.setModesessionTurn read-only plan mode on or off

Accounting

MethodScopePurpose
cost.getsessionToken and cost totals for this session
context.getsessionContext-window occupancy and the compaction trigger

Background agents

The REPL calls these "background" and "agents". The protocol calls a dispatched conversation an agent. "background" describes where it runs rather than what it is, and a client that is not a terminal has no foreground to contrast it with.

MethodScopePurpose
agents.listhostRunning, stopped and blocked agents
agents.dispatchsessionDispatch a detached agent
agents.attachsessionAttach to a dispatched agent's event stream
agents.stophostStop an agent by id

See Background Agents & Jobs.

Jobs

MethodScopePurpose
jobs.listhostRunning background jobs
jobs.tailhostTail a job's output
jobs.killhostKill a job
jobs.detachhostDetach a job so the turn stops waiting on it. The job keeps running

Configuration

MethodScopeGatedPurpose
config.schemahostNoWhich keys are writable, which are refused, and why
config.gethostNoThe resolved configuration
config.sethostYesWrite a configuration key

config.get reports whether api_key is set, never what it is. A settings dump is exactly the shape of thing that ends up in a bug report.

Keys config.set always refuses

skip_permissions, mode, cwd, api_key, actor

These decide how much the model may do without asking, and they persist. config.schema names them and the reason, so a client can explain the refusal rather than looking broken.

Memory

MethodScopePurpose
memory.listhostList persistent per-project notes
memory.gethostRead one entry
memory.deletehostDelete one entry

Entries resolve through the same realpath check the Memory tool uses.

Modules and assessment

MethodScopeGatedPurpose
modules.listhostNoWhich capability packs this build has, and which are active
checks.listhostNoThe check catalogue
checks.runhostYesRun conformance checks
audit.runhostYesRun a profile and return the report

See Conformance Checks and Audit Reports.

MCP

MethodScopePurpose
mcp.servershostConnected MCP servers and their tools

There is no mcp.login

An OAuth browser flow needs a browser and a terminal a served process does not have. Run oasis-agent --mcp-login out of band instead. See MCP Integration.

Adding the method later would be additive; shipping it early would be a permanent commitment made before anyone asked for it.

Host lifecycle

MethodScopeGatedPurpose
versionhostNoVersion, commit and build date
doctorhostNoInstallation report: versions on disk, active version, setting provenance
update.checkhostNoWhether a newer version is published
update.applyhostYesInstall and activate the newest version

Host-mutating methods

Four methods reshape the host and are off by default:

MethodWhy it is gated
config.setWrites settings that outlive the session
checks.runExecutes probes against the machine
audit.runExecutes probes against the machine
update.applyReplaces the running binary

Enable them explicitly:

bash
oasis-agent serve --unix /run/oasis.sock --allow-host-mutations

Without the flag they are declared, absent from features[], and answer unsupported with a reason naming the flag.

Errors

ReasonMeaning
frame_too_largeThe frame exceeded 16 MiB. Typed, not a disconnect
unsupportedThe method is declared but not enabled in this build
Timeout on consentNobody answered a permission.required within the window

Discovering what a build answers

Do not infer the method set from the protocol version. Read features[] from the hello response. It lists exactly the wire names this build answers, with gated methods excluded.

software-defined automation