Skip to main content

Overview

Call track_agent_error whenever something goes wrong during an agent turn — rate limits, timeouts, guardrail blocks, tool failures, context length overflows, or any other exception. Use the same messageId / message_id as the originating track_agent_call event so errors are correlated to the turn in your dashboards.

Required fields

Node.js / Python SDK: distinctId / distinct_id is also required. Browser SDK: optional if the user has already called Trodo.identify() in the session.
Field (Node / Browser)Field (Python)TypeDescription
agentIdagent_idstringThe registered agent ID — e.g. 'agt_abc12345'
conversationIdconversation_idstringStable ID for the conversation thread
messageIdmessage_idstringUnique ID for this specific message turn
distinctIddistinct_idstringLinks the event to a Trodo user (required in Node/Python; optional in Browser if identify() was called)

Optional fields

Field (Node / Browser)Field (Python)TypeDescription
errorTypeerror_typestringCategory — e.g. 'timeout', 'rate_limit', 'guardrail_block', 'tool_failure', 'context_length'
errorMessageerror_messagestringHuman-readable error description
failedToolsfailed_toolsstring or string[]The tool(s) that caused the error — a single name or a list
tracebacktracebackstringStack trace (stored in properties.traceback)
timestamptimestampISO 8601 stringOverride event time

Examples

// Rate limit from the LLM provider
Trodo.track_agent_error({
  agentId: 'agt_abc12345',
  conversationId: 'conv_9kx2m7pq',
  messageId: 'msg_01jf3t8r',
  errorType: 'rate_limit',
  errorMessage: 'OpenAI rate limit exceeded — too many requests per minute.',
});
Common errorType values: 'timeout', 'rate_limit', 'guardrail_block', 'tool_failure', 'context_length', 'invalid_response'. Use consistent values across your codebase so you can filter and group errors reliably in your dashboards.