curl --request POST \
--url http://127.0.0.1:8081/v1/rpc/agent.diagnose \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "agent.diagnose",
"id": "<string>"
}
'import requests
url = "http://127.0.0.1:8081/v1/rpc/agent.diagnose"
payload = {
"jsonrpc": "2.0",
"method": "agent.diagnose",
"id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({jsonrpc: '2.0', method: 'agent.diagnose', id: '<string>'})
};
fetch('http://127.0.0.1:8081/v1/rpc/agent.diagnose', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8081",
CURLOPT_URL => "http://127.0.0.1:8081/v1/rpc/agent.diagnose",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'method' => 'agent.diagnose',
'id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:8081/v1/rpc/agent.diagnose"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"agent.diagnose\",\n \"id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://127.0.0.1:8081/v1/rpc/agent.diagnose")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"agent.diagnose\",\n \"id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:8081/v1/rpc/agent.diagnose")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"method\": \"agent.diagnose\",\n \"id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "<string>",
"result": {
"agent_id": "<string>",
"queue": {
"oldest_pending_age_seconds": 1,
"pending_count": 1,
"pending_deliveries": [
{
"attempts": 1,
"enqueued_at": "2023-11-07T05:31:56Z",
"event_id": "<string>",
"event_name": "<string>"
}
],
"next_cursor": "<string>"
},
"status": "idle",
"active": {
"turn_id": "<string>",
"entity_id": "<string>",
"task_id": "<string>"
},
"current_session_ref": {
"session_id": "<string>",
"started_at": "2023-11-07T05:31:56Z"
},
"delivery_lifecycle": {
"blocking_layer": "<string>",
"state": "queued"
},
"last_tool_outcome": {
"ok": true,
"tool_name": "<string>",
"turn_id": "<string>",
"result": {},
"tool_use_id": "<string>"
},
"last_turn_ref": {
"completed_at": "2023-11-07T05:31:56Z",
"parse_ok": true,
"turn_id": "<string>",
"error": "<string>"
},
"runtime_state": {
"watchdog": {
"action": "turn_long_running",
"blocking_layer": "session_execution",
"outcome": "observed",
"recorded_at": "2023-11-07T05:31:56Z",
"state": "healthy_long_running",
"last_output_at": "2023-11-07T05:31:56Z"
}
}
}
}agent.diagnose
Read the owner-backed diagnosis slice for one agent. This method is limited to agent identity/status refs, current/last conversation refs, pending-delivery queue summary/detail evidence, and optional delivery lifecycle evidence. It may also return runtime_state.watchdog as a narrow projection of the canonical active session watchdog descriptor, active as selected active-session latest-turn refs, and last_tool_outcome as compact selected active-session latest-turn canonical tool-result evidence. active is omitted when no active live session is selected or the selected session has no latest turn. active.turn_id is required when active is present; active.task_id and active.entity_id are omitted when empty or absent. active.entity_id is the latest selected agent_turns.entity_id dispatch entity and must not fall back to the agent configured/effective entity, task target entity, role-scoped current-entity tool context, dashboard projection, conversation API response, or stale session evidence. last_tool_outcome is omitted when no active live session is selected, no latest turn exists, no canonical turn summary exists, or the canonical summary has no tool result. last_tool_outcome.ok is the selected turn parse_ok value and is not a per-tool execution status; richer per-tool status, latency, completed_at, and error diagnostics remain split. runtime_state.watchdog is omitted when no active live session or no active-session watchdog evidence exists, and malformed watchdog data fails closed. Queue details are paged with queue_limit and queue_cursor, ordered by events.created_at ASC then events.event_id ASC. AgentPendingDelivery.enqueued_at uses the same timestamp owner as oldest_pending_age_seconds. AgentPendingDelivery.attempts is the canonical recorded retry counter from event_deliveries.retry_count, with no API-layer +1 or status arithmetic. The API handler consumes the canonical agent diagnosis read owner directly, including its watchdog-backed runtime_state sub-owner, selected-turn active sub-owner, and selected-turn last_tool_outcome sub-owner. It must not locally join conversation, run, trace, token, CLI, or dashboard owners, and it must not expose the full runtime_state enum, top-level watchdog, run_id, bundle_version, actual in-flight active work, configured/effective current entity, task target entity, role-scoped current entity, token usage, recent failures, or dead letters.
Transport: all methods are a single POST /v1/rpc with the method name in the JSON-RPC body. The path shown is a per-method convenience.
curl --request POST \
--url http://127.0.0.1:8081/v1/rpc/agent.diagnose \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "agent.diagnose",
"id": "<string>"
}
'import requests
url = "http://127.0.0.1:8081/v1/rpc/agent.diagnose"
payload = {
"jsonrpc": "2.0",
"method": "agent.diagnose",
"id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({jsonrpc: '2.0', method: 'agent.diagnose', id: '<string>'})
};
fetch('http://127.0.0.1:8081/v1/rpc/agent.diagnose', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8081",
CURLOPT_URL => "http://127.0.0.1:8081/v1/rpc/agent.diagnose",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'method' => 'agent.diagnose',
'id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:8081/v1/rpc/agent.diagnose"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"agent.diagnose\",\n \"id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://127.0.0.1:8081/v1/rpc/agent.diagnose")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"agent.diagnose\",\n \"id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:8081/v1/rpc/agent.diagnose")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"method\": \"agent.diagnose\",\n \"id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "<string>",
"result": {
"agent_id": "<string>",
"queue": {
"oldest_pending_age_seconds": 1,
"pending_count": 1,
"pending_deliveries": [
{
"attempts": 1,
"enqueued_at": "2023-11-07T05:31:56Z",
"event_id": "<string>",
"event_name": "<string>"
}
],
"next_cursor": "<string>"
},
"status": "idle",
"active": {
"turn_id": "<string>",
"entity_id": "<string>",
"task_id": "<string>"
},
"current_session_ref": {
"session_id": "<string>",
"started_at": "2023-11-07T05:31:56Z"
},
"delivery_lifecycle": {
"blocking_layer": "<string>",
"state": "queued"
},
"last_tool_outcome": {
"ok": true,
"tool_name": "<string>",
"turn_id": "<string>",
"result": {},
"tool_use_id": "<string>"
},
"last_turn_ref": {
"completed_at": "2023-11-07T05:31:56Z",
"parse_ok": true,
"turn_id": "<string>",
"error": "<string>"
},
"runtime_state": {
"watchdog": {
"action": "turn_long_running",
"blocking_layer": "session_execution",
"outcome": "observed",
"recorded_at": "2023-11-07T05:31:56Z",
"state": "healthy_long_running",
"last_output_at": "2023-11-07T05:31:56Z"
}
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

