Maximum number of error entries to return.
/api/health/errorsGet Health Errors
Query the persistent error log for recent errors. Supports pagination with limit and text search filtering.
Overview
Returns recent entries from the persistent error log at ~/.mudabbir/health/errors.jsonl. Errors are stored across sessions and survive page refresh and server restart.
Results are returned newest-first. Use the search parameter to filter errors by text content across the message, source, and traceback fields.
Query Parameters
limit integersearch stringOptional text filter. Searches across message, source, and traceback fields (case-insensitive).
Response
Returns an array of error entries. Each entry is an object with:
id string12-character hex error ID (e.g. a1b2c3d4e5f6).
timestamp stringISO 8601 UTC timestamp of when the error was recorded.
source stringWhere the error originated. Common values: agent_loop, deep_work, tool_execution, unknown.
severity stringError severity: error or warning.
message stringHuman-readable error description.
traceback stringPython traceback string, if available. Empty string if no traceback was captured.
context objectAdditional metadata. Contents vary by error source — may include session_id, backend, tool_name, etc.
# Get last 10 errorscurl -X GET "http://localhost:8888/api/health/errors?limit=10"
# Search for API-related errorscurl -X GET "http://localhost:8888/api/health/errors?search=api&limit=5"// Get recent errorsconst response = await fetch("http://localhost:8888/api/health/errors?limit=10");const errors = await response.json();
// Search for specific errorsconst filtered = await fetch( "http://localhost:8888/api/health/errors?search=timeout&limit=5");const results = await filtered.json();import requests
# Get recent errorsresponse = requests.get( "http://localhost:8888/api/health/errors", params={"limit": 10})errors = response.json()
# Search for specific errorsresponse = requests.get( "http://localhost:8888/api/health/errors", params={"search": "anthropic", "limit": 5})[ { "id": "a1b2c3d4e5f6", "timestamp": "2025-03-15T10:30:00+00:00", "source": "agent_loop", "severity": "error", "message": "Anthropic API returned 401: Invalid API key", "traceback": "Traceback (most recent call last):\n File \"agent/loop.py\", line 142\n ...\nanthropic.AuthenticationError: Invalid API key", "context": { "session_id": "abc123", "backend": "claude_agent_sdk" } }, { "id": "f6e5d4c3b2a1", "timestamp": "2025-03-15T10:25:00+00:00", "source": "deep_work", "severity": "error", "message": "Task execution failed: connection timed out", "traceback": "", "context": { "project_id": "proj_001", "task_index": 3 } }]curl -X GET "http://localhost:8888/api/health/errors" \
-H "Content-Type: application/json"const response = await fetch("http://localhost:8888/api/health/errors", {
method: "GET",
headers: {
"Content-Type": "application/json"
},
});
const data = await response.json();
console.log(data);import requests
response = requests.get(
"http://localhost:8888/api/health/errors",
headers={'Content-Type':'application/json'},
)
print(response.json())package main
import (
"fmt"
"net/http"
"io"
)
func main() {
req, _ := http.NewRequest("GET", "http://localhost:8888/api/health/errors", nil)
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}