Skip to content

Send a diagnostic ping to a registered agent

POST
/api/agent-communication/test/ping-agent/{agent_id}

Send a diagnostic ping to an agent and measure queue-append latency.

Uses :meth:AgentCommunicationHub.ping_agent, which bypasses permission checks (diagnostic traffic is infrastructure, not an authorized agent-to-agent conversation) and routes through the hub-owned "hub_diagnostic" sender identity so agent processing loops filter it out of get_messages before spending LLM cycles on it.

Path Parameters:

  • agent_id: Target agent identifier. Must be registered with the hub.

Query Parameters:

  • test_message: Optional custom ping content.

Returns:

  • :class:PingAgentResponse with ping_successful True and non-zero response_time_ms on success.

Raises:

  • HTTPException 404: Target agent is not registered with the hub.
  • HTTPException 503: Communication hub unavailable.
  • HTTPException 500: Unexpected hub error during the ping.
agent_id
required
Agent Id
string
test_message
Test Message
string
default: hub diagnostic ping

Successful Response

PingAgentResponse

Ping agent response model.

Provides connectivity and health check response for agent ping operations including response time and success status. Used for agent connectivity testing and health monitoring endpoints.

Fields:

  • status: Operation status (success/error)
  • ping_successful: Boolean indicating successful ping response
  • agent_id: Identifier of the pinged agent
  • response_time_ms: Response time in milliseconds (non-negative float)
  • message: Response message providing additional context

Usage: POST /api/agent-communication/ping-agent returns this response model.

JSON Example:

{
  "status": "success",
  "pingSuccessful": true,
  "agentId": "hawken",
  "responseTimeMs": 45.2,
  "message": "Agent is responsive"
}
object
status
required
Status

Operation status

string
pingSuccessful
required
Pingsuccessful

Ping success status

boolean
agentId
required
Agentid

Pinged agent ID

string
responseTimeMs
required
Responsetimems

Response time in ms

number
message
required
Message

Response message

string

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object