Overview
Theagent channel carries AI agent prompts, streaming responses, and tool interactions. The agent processes natural language prompts, executes tools in the workspace, and streams results back to the client.
Client to Server Messages
prompt
Start a new agent task with a natural language prompt.
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Natural language instruction for the agent |
taskId | string | No | Client-generated task identifier for tracking |
settings
Configure agent behavior for the current session.
| Field | Type | Required | Description |
|---|---|---|---|
provider | string | No | LLM provider name |
model | string | No | Model identifier |
abort
Cancel a running agent task.
| Field | Type | Required | Description |
|---|---|---|---|
taskId | string | Yes | Task to cancel |
tool_response
Respond to a tool call that requires user input.
| Field | Type | Required | Description |
|---|---|---|---|
toolCallId | string | Yes | ID of the tool call to respond to |
result | string | Yes | User’s response |
approve
Approve a permission request from the agent (e.g., before running a destructive command).
| Field | Type | Required | Description |
|---|---|---|---|
requestId | string | Yes | Permission request to approve |
reject
Reject a permission request from the agent.
| Field | Type | Required | Description |
|---|---|---|---|
requestId | string | Yes | Permission request to reject |
Server to Client Events
The agent streams events as it processes a task. Events arrive in order and represent the agent’s reasoning, tool use, and final output.text
Streamed text output from the agent.
| Field | Type | Description |
|---|---|---|
content | string | Incremental text content |
text events to build the full response.
thinking
Agent reasoning content (available for models that support extended thinking).
| Field | Type | Description |
|---|---|---|
content | string | Internal reasoning text |
tool_invocation
The agent is calling a tool.
| Field | Type | Description |
|---|---|---|
toolCallId | string | Unique identifier for this tool call |
toolName | string | Name of the tool being invoked |
args | object | Arguments passed to the tool |
tool_result
A tool call has completed.
| Field | Type | Description |
|---|---|---|
toolCallId | string | ID of the completed tool call |
result | string or object | Tool execution result |
question
The agent is asking the user for input.
| Field | Type | Description |
|---|---|---|
questions | array of strings | Questions the agent needs answered |
tool_response message to continue the agent’s task.
result
The agent task has completed.
| Field | Type | Description |
|---|---|---|
summary | string | Summary of what was accomplished |
error
The agent task failed.
| Field | Type | Description |
|---|---|---|
message | string | Error description |