This endpoint is currently in ALPHA status and is subject to change. We welcome your feedback to help improve this API.
The Agent Run Logs API allows you to retrieve detailed execution logs for agent runs, providing insights into the agent’s thought process, tool usage, and execution flow.
This endpoint requires API token authentication. Include your token in the Authorization header:
Parameter | Type | Required | Description |
---|---|---|---|
org_id | integer | Yes | Your organization ID |
agent_run_id | integer | Yes | The ID of the agent run to retrieve logs for |
skip | integer | No | Number of logs to skip for pagination (default: 0) |
limit | integer | No | Maximum number of logs to return (default: 100, max: 100) |
The endpoint returns an AgentRunWithLogsResponse
object containing the agent run details and paginated logs:
Each log entry in the logs
array contains the following fields:
Field | Type | Description |
---|---|---|
agent_run_id | integer | The ID of the agent run this log belongs to |
created_at | string | ISO 8601 timestamp when the log entry was created |
message_type | string | The type of log entry (see Log Types below) |
Field | Type | Description |
---|---|---|
thought | string | null | The agent’s internal reasoning or thought process for this step |
Field | Type | Description |
---|---|---|
tool_name | string | null | Name of the tool being executed (e.g., “ripgrep_search”, “file_write”) |
tool_input | object | null | JSON object containing the parameters passed to the tool |
tool_output | object | null | JSON object containing the tool’s execution results |
observation | object | string | null | The agent’s observation of the tool execution results or other contextual data |
The message_type
field indicates the type of log entry. Here are the possible values:
Type | Description |
---|---|
ACTION | The agent is executing a tool or taking an action |
PLAN_EVALUATION | The agent is evaluating or updating its plan |
FINAL_ANSWER | The agent is providing its final response or conclusion |
ERROR | An error occurred during execution |
USER_MESSAGE | A message from the user (e.g., interruptions or additional context) |
USER_GITHUB_ISSUE_COMMENT | A comment from a GitHub issue that the agent is processing |
Type | Description |
---|---|
INITIAL_PR_GENERATION | The agent is generating the initial pull request |
DETECT_PR_ERRORS | The agent is detecting errors in a pull request |
FIX_PR_ERRORS | The agent is fixing errors found in a pull request |
PR_CREATION_FAILED | Pull request creation failed |
PR_EVALUATION | The agent is evaluating a pull request |
Type | Description |
---|---|
COMMIT_EVALUATION | The agent is evaluating commits |
Type | Description |
---|---|
AGENT_RUN_LINK | A link to another related agent run |
Different log types populate different fields:
tool_name
, tool_input
, tool_output
thought
, observation
thought
observation
observation
(containing error details)tool_name
(if error occurred during tool execution)observation
(containing the final response)thought
Use the logs to create dashboards showing:
Analyze logs to understand:
Track agent actions for:
Monitor:
Status Code | Description |
---|---|
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing API token |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Agent run not found |
429 | Too Many Requests - Rate limit exceeded |
Since this endpoint is in ALPHA, we’d love your feedback! Please reach out through:
The structure and fields of this API may change as we gather feedback and improve the service. We’ll provide advance notice of any breaking changes.