localhost:8080). gRPC requires HTTP/2. The service is defined in proto/roz/v1/agent.proto.
gRPC reflection is enabled, so you can inspect the API with grpcurl:
Service Definition
Session Protocol
A session is a bidirectional stream. The client sendsSessionRequest messages and receives SessionResponse messages. The typical flow is:
StartSession
Opens a new agent session. The server responds withSessionStarted.
| Field | Type | Description |
|---|---|---|
environment_id | string | Environment to run in. |
host_id | string (optional) | Target edge host for OODA mode. |
model | string (optional) | LLM model override (e.g. "claude-sonnet-4-20250514"). |
tools | ToolSchema[] | Initial set of tools the client provides. |
history | ConversationMessage[] | Previous conversation to resume. |
project_context | string[] | Project-specific context blocks (e.g. AGENTS.md content). |
max_context_tokens | uint32 (optional) | Context window budget. |
SessionStarted
Confirms the session is active.| Field | Type | Description |
|---|---|---|
session_id | string | Unique session identifier. |
model | string | The model being used. |
permissions | PermissionRule[] | Tool permission policies for this session. |
UserMessage
Sends a user prompt to the agent.| Field | Type | Description |
|---|---|---|
content | string | The user’s message text. |
context | ContentBlock[] | Additional context (text or binary). |
ai_mode | string (optional) | Force a specific agent mode ("react" or "ooda_re_act"). |
message_id | string (optional) | Client-generated ID, echoed in response chunks. |
tools | ToolSchema[] | Full tool snapshot for this turn (replaces session tools if present). |
system_context | string (optional) | Per-turn system context injection. |
TextDelta / ThinkingDelta
Streamed response chunks from the agent.TextDelta contains visible output. ThinkingDelta contains the model’s internal reasoning (when extended thinking is enabled).
| Field | Type | Description |
|---|---|---|
message_id | string | Matches the UserMessage.message_id. |
content | string | The text chunk. |
TurnComplete
Signals that the agent has finished responding to aUserMessage.
| Field | Type | Description |
|---|---|---|
message_id | string | Matches the UserMessage.message_id. |
usage | TokenUsage | Token counts for this turn. |
stop_reason | string | Why the turn ended ("end_turn", "max_tokens", etc.). |
Tool Protocol
Tools are functions that the client can execute on behalf of the agent. The flow is:- Client registers tools via
StartSession.tools,RegisterTools, orUserMessage.tools. - During a turn, the server sends a
ToolRequestasking the client to execute a tool. - The client executes the tool and sends back a
ToolResult. - The agent incorporates the result and continues reasoning.
RegisterTools
Dynamically add or remove tools mid-session. Typical use: when a sim container starts, the IDE discovers its MCP tools and registers them with the session.| Field | Type | Description |
|---|---|---|
source | string (optional) | Identifies the tool set owner (e.g. container ID). Tools prefixed with "{source}__" are replaced. |
tools | ToolSchema[] | Replacement tool list. Empty list = unregister all tools from this source. |
system_context | string (optional) | Workflow guidance for this tool set. |
ToolRequest (server to client)
| Field | Type | Description |
|---|---|---|
tool_call_id | string | Unique ID for this tool invocation. |
tool_name | string | Name of the tool to execute. |
parameters | Struct | JSON parameters for the tool. |
timeout_ms | uint32 | Maximum execution time. |
ToolResult (client to server)
| Field | Type | Description |
|---|---|---|
tool_call_id | string | Matches the ToolRequest.tool_call_id. |
success | bool | Whether execution succeeded. |
result | string | Output text from the tool. |
exit_code | int32 (optional) | Shell exit code if applicable. |
truncated | bool | Whether the output was truncated. |
duration_ms | int64 (optional) | Wall-clock execution time. |
ToolSchema
Describes a tool that the client can execute.| Field | Type | Description |
|---|---|---|
name | string | Tool name. |
description | string | Human-readable description. |
parameters_schema | Struct | JSON Schema for the tool’s parameters. |
timeout_ms | uint32 | Default timeout. |
category | ToolCategoryHint | PHYSICAL or PURE (affects UI presence). |
Permission Protocol
The server can request user approval before executing certain tools.- Server sends
ActivityUpdatewith state"waiting_approval". - Client shows an approval dialog to the user.
- Client sends
PermissionDecisionwith thetool_call_idand the user’s decision.
WatchTeam
Stream worker lifecycle events for multi-agent task execution.WorkerStarted, WorkerPhase, WorkerToolCall, WorkerCompleted, WorkerFailed, and WorkerExited.
Other Response Types
| Message | Description |
|---|---|
SessionError | Error with code, message, and retryable flag. |
Keepalive | Periodic heartbeat with optional token usage. |
Pong | Response to client Ping. |
ContextCompacted | Notification that the context window was compacted (with before/after token counts). |
PresenceHint | UI visibility hint ("full", "mini", "hidden"). |
ActivityUpdate | Agent state change ("thinking", "calling_tool", "idle", "waiting_approval"). |
Source Code
Proto definition:proto/roz/v1/agent.proto