Real-time session execution stream.
{
"type": "ack",
"resume_from": ""
}{
"kind": "state.snapshot",
"payload": {
"schema": "v1",
"task_id": "task_abc123",
"chat_id": "chat_def456",
"message_id": "msg_ghi789",
"status": {
"phase": "running",
"eta_seconds": 60
},
"blocks": [],
"last_event_id": 0,
"last_stream_entry_id": "0-0",
"has_dev_server": false
}
}{
"event_id": 1,
"timestamp": 1703001234000,
"kind": "task.phase",
"message_id": "msg_ghi789",
"payload": {
"phase": "running",
"eta_seconds": 60
}
}{
"event_id": 2,
"timestamp": 1703001234100,
"kind": "block.create",
"block_id": "answer:main",
"message_id": "msg_ghi789",
"payload": {
"type": "markdown",
"initial_state": {}
}
}{
"event_id": 50,
"timestamp": 1703001250000,
"kind": "block.update",
"block_id": "answer:main",
"message_id": "msg_ghi789",
"payload": {
"patch": {
"final": true
}
}
}{
"event_id": 5,
"timestamp": 1703001234500,
"kind": "markdown.chunk",
"block_id": "answer:main",
"message_id": "msg_ghi789",
"payload": {
"delta": "Here's a Python script that"
}
}{
"event_id": 3,
"timestamp": 1703001234200,
"kind": "thought",
"block_id": "thought:reasoning",
"message_id": "msg_ghi789",
"payload": {
"thought": "Let me analyze the requirements...",
"finalize": false
}
}{
"event_id": 4,
"timestamp": 1703001234300,
"kind": "text",
"block_id": "text:message",
"message_id": "msg_ghi789",
"payload": {
"text": "Processing your request"
}
}{
"event_id": 10,
"timestamp": 1703001235000,
"kind": "tool.start",
"block_id": "tool:bash:run-1",
"message_id": "msg_ghi789",
"payload": {
"tool_name": "bash"
}
}{
"event_id": 11,
"timestamp": 1703001235100,
"kind": "tool.parameters",
"block_id": "tool:bash:run-1",
"message_id": "msg_ghi789",
"payload": {
"parameters": {
"command": "pip install requests"
}
}
}{
"event_id": 12,
"timestamp": 1703001235500,
"kind": "tool.log",
"block_id": "tool:bash:run-1",
"message_id": "msg_ghi789",
"payload": {
"stream": "stdout",
"data": "Collecting requests\n Downloading requests-2.31.0.whl\n"
}
}{
"event_id": 15,
"timestamp": 1703001236000,
"kind": "tool.result",
"block_id": "tool:bash:run-1",
"message_id": "msg_ghi789",
"payload": {
"status": "success",
"output": {
"exit_code": 0
},
"finalize": true
}
}{
"event_id": 20,
"timestamp": 1703001240000,
"kind": "plan.update",
"block_id": "plan:root",
"message_id": "msg_ghi789",
"payload": {
"patch": {
"todos": [
{
"id": "todo_1",
"content": "Set up project structure",
"status": "completed"
},
{
"id": "todo_2",
"content": "Implement main logic",
"status": "active"
},
{
"id": "todo_3",
"content": "Add tests",
"status": "pending"
}
]
}
}
}{
"event_id": 25,
"timestamp": 1703001245000,
"kind": "focus",
"block_id": "focus",
"message_id": "msg_ghi789",
"payload": {
"text": "Implementing authentication logic"
}
}{
"event_id": 1,
"timestamp": 1703001230000,
"kind": "message.received",
"message_id": "msg_ghi789",
"payload": {
"text": "Build a REST API with authentication",
"files": [],
"references": []
}
}{
"event_id": 35,
"timestamp": 1703001252000,
"kind": "sandbox.snapshot",
"message_id": "msg_ghi789",
"payload": {
"sandbox_id": "sbx_abc123",
"snapshot": {
"src/main.py": {
"key": "src/main.py",
"name": "main.py",
"updatedAt": 1703001252000
}
},
"deleted": []
}
}{
"event_id": 30,
"timestamp": 1703001250000,
"kind": "context.usage",
"message_id": "msg_ghi789",
"payload": {
"consumed_tokens": 15000,
"total_tokens": 200000,
"usage_pct": 7.5
}
}{
"event_id": 40,
"timestamp": 1703001255000,
"kind": "dev.server.ready",
"message_id": "msg_ghi789",
"payload": {}
}{
"event_id": 45,
"timestamp": 1703001258000,
"kind": "web.plan.request",
"block_id": "web_plan:request",
"message_id": "msg_ghi789",
"payload": {
"title": "Build Authentication System",
"summary": "I'll implement a JWT-based auth system",
"sections": [
{
"id": "section_1",
"title": "Authentication Method",
"items": [
{
"id": "item_1",
"label": "JWT Authentication",
"description": "JSON Web Tokens for stateless auth",
"item_type": "radio",
"selected": true,
"options": [
{
"id": "opt_1",
"label": "JWT",
"description": "Stateless tokens",
"selected": true
},
{
"id": "opt_2",
"label": "Session",
"description": "Server-side sessions",
"selected": false
}
]
}
]
}
]
}
}{
"event_id": 100,
"timestamp": 1703001300000,
"kind": "task.completed",
"message_id": "msg_ghi789",
"payload": {}
}{
"event_id": 55,
"timestamp": 1703001265000,
"kind": "task.aborted",
"message_id": "msg_ghi789",
"payload": {
"reason": "User requested stop"
}
}{
"event_id": 50,
"timestamp": 1703001260000,
"kind": "task.error",
"message_id": "msg_ghi789",
"payload": {
"message": "Failed to execute code",
"code": "execution_error"
}
}{
"type": "MESSAGE",
"content": "Also add error handling for network failures",
"timestamp": 1703001270000
}{
"type": "STOP"
}{
"type": "RETRACT",
"timestamp": 1703001270000
}{
"type": "FILE_EDITS",
"payload": {
"edits": [
{
"key": "src/main.py",
"content": "# updated content\nprint('hello')",
"contentType": "text/x-python"
}
]
},
"timestamp": 1703001280000
}Session ID from start a new turn endpoint
Message ID from start a new turn endpoint.
Raccoon AI API key
Other optional query params:
- last_stream_entry_id - Last received stream entry ID for reconnection (e.g., "0-0")
Confirms WebSocket connection established
Complete current state of the task
Task execution phase changed
New content block created
Existing block state updated
Streaming markdown content
Agent reasoning/thinking content
Plain text content
Tool execution started
Parameters passed to tool
Tool stdout/stderr output
Tool execution completed
Todo list updated
Agent's current focus/activity
User message received by agent
Sandbox file system state updated
LLM context window usage
Development server started
Agent requesting user approval for plan
Task finished successfully
Task stopped by user or system
Task failed with error
Send a message to the running task
Stop the running task
Retract the last queued message
Notify agent of user file edits
Was this page helpful?
{
"type": "ack",
"resume_from": ""
}{
"kind": "state.snapshot",
"payload": {
"schema": "v1",
"task_id": "task_abc123",
"chat_id": "chat_def456",
"message_id": "msg_ghi789",
"status": {
"phase": "running",
"eta_seconds": 60
},
"blocks": [],
"last_event_id": 0,
"last_stream_entry_id": "0-0",
"has_dev_server": false
}
}{
"event_id": 1,
"timestamp": 1703001234000,
"kind": "task.phase",
"message_id": "msg_ghi789",
"payload": {
"phase": "running",
"eta_seconds": 60
}
}{
"event_id": 2,
"timestamp": 1703001234100,
"kind": "block.create",
"block_id": "answer:main",
"message_id": "msg_ghi789",
"payload": {
"type": "markdown",
"initial_state": {}
}
}{
"event_id": 50,
"timestamp": 1703001250000,
"kind": "block.update",
"block_id": "answer:main",
"message_id": "msg_ghi789",
"payload": {
"patch": {
"final": true
}
}
}{
"event_id": 5,
"timestamp": 1703001234500,
"kind": "markdown.chunk",
"block_id": "answer:main",
"message_id": "msg_ghi789",
"payload": {
"delta": "Here's a Python script that"
}
}{
"event_id": 3,
"timestamp": 1703001234200,
"kind": "thought",
"block_id": "thought:reasoning",
"message_id": "msg_ghi789",
"payload": {
"thought": "Let me analyze the requirements...",
"finalize": false
}
}{
"event_id": 4,
"timestamp": 1703001234300,
"kind": "text",
"block_id": "text:message",
"message_id": "msg_ghi789",
"payload": {
"text": "Processing your request"
}
}{
"event_id": 10,
"timestamp": 1703001235000,
"kind": "tool.start",
"block_id": "tool:bash:run-1",
"message_id": "msg_ghi789",
"payload": {
"tool_name": "bash"
}
}{
"event_id": 11,
"timestamp": 1703001235100,
"kind": "tool.parameters",
"block_id": "tool:bash:run-1",
"message_id": "msg_ghi789",
"payload": {
"parameters": {
"command": "pip install requests"
}
}
}{
"event_id": 12,
"timestamp": 1703001235500,
"kind": "tool.log",
"block_id": "tool:bash:run-1",
"message_id": "msg_ghi789",
"payload": {
"stream": "stdout",
"data": "Collecting requests\n Downloading requests-2.31.0.whl\n"
}
}{
"event_id": 15,
"timestamp": 1703001236000,
"kind": "tool.result",
"block_id": "tool:bash:run-1",
"message_id": "msg_ghi789",
"payload": {
"status": "success",
"output": {
"exit_code": 0
},
"finalize": true
}
}{
"event_id": 20,
"timestamp": 1703001240000,
"kind": "plan.update",
"block_id": "plan:root",
"message_id": "msg_ghi789",
"payload": {
"patch": {
"todos": [
{
"id": "todo_1",
"content": "Set up project structure",
"status": "completed"
},
{
"id": "todo_2",
"content": "Implement main logic",
"status": "active"
},
{
"id": "todo_3",
"content": "Add tests",
"status": "pending"
}
]
}
}
}{
"event_id": 25,
"timestamp": 1703001245000,
"kind": "focus",
"block_id": "focus",
"message_id": "msg_ghi789",
"payload": {
"text": "Implementing authentication logic"
}
}{
"event_id": 1,
"timestamp": 1703001230000,
"kind": "message.received",
"message_id": "msg_ghi789",
"payload": {
"text": "Build a REST API with authentication",
"files": [],
"references": []
}
}{
"event_id": 35,
"timestamp": 1703001252000,
"kind": "sandbox.snapshot",
"message_id": "msg_ghi789",
"payload": {
"sandbox_id": "sbx_abc123",
"snapshot": {
"src/main.py": {
"key": "src/main.py",
"name": "main.py",
"updatedAt": 1703001252000
}
},
"deleted": []
}
}{
"event_id": 30,
"timestamp": 1703001250000,
"kind": "context.usage",
"message_id": "msg_ghi789",
"payload": {
"consumed_tokens": 15000,
"total_tokens": 200000,
"usage_pct": 7.5
}
}{
"event_id": 40,
"timestamp": 1703001255000,
"kind": "dev.server.ready",
"message_id": "msg_ghi789",
"payload": {}
}{
"event_id": 45,
"timestamp": 1703001258000,
"kind": "web.plan.request",
"block_id": "web_plan:request",
"message_id": "msg_ghi789",
"payload": {
"title": "Build Authentication System",
"summary": "I'll implement a JWT-based auth system",
"sections": [
{
"id": "section_1",
"title": "Authentication Method",
"items": [
{
"id": "item_1",
"label": "JWT Authentication",
"description": "JSON Web Tokens for stateless auth",
"item_type": "radio",
"selected": true,
"options": [
{
"id": "opt_1",
"label": "JWT",
"description": "Stateless tokens",
"selected": true
},
{
"id": "opt_2",
"label": "Session",
"description": "Server-side sessions",
"selected": false
}
]
}
]
}
]
}
}{
"event_id": 100,
"timestamp": 1703001300000,
"kind": "task.completed",
"message_id": "msg_ghi789",
"payload": {}
}{
"event_id": 55,
"timestamp": 1703001265000,
"kind": "task.aborted",
"message_id": "msg_ghi789",
"payload": {
"reason": "User requested stop"
}
}{
"event_id": 50,
"timestamp": 1703001260000,
"kind": "task.error",
"message_id": "msg_ghi789",
"payload": {
"message": "Failed to execute code",
"code": "execution_error"
}
}{
"type": "MESSAGE",
"content": "Also add error handling for network failures",
"timestamp": 1703001270000
}{
"type": "STOP"
}{
"type": "RETRACT",
"timestamp": 1703001270000
}{
"type": "FILE_EDITS",
"payload": {
"edits": [
{
"key": "src/main.py",
"content": "# updated content\nprint('hello')",
"contentType": "text/x-python"
}
]
},
"timestamp": 1703001280000
}