Repository navigation
Description
Summary
The MCP tool get_fleet_health consistently returns 500 Internal Server Error, while get_agent_health for every individual agent in the same fleet returns 200 with aggregate_status: "healthy". Because the per-agent path works, the bug appears to be in the fleet aggregation logic on the backend — most likely choking on agents whose 24h health rollups have not been refreshed.
Environment
- Trinity backend: production
- Reproduced from: MCP client (Claude Code), 2026-05-05
- Fleet size: 9 agents
- MCP tool:
get_fleet_health→GET /api/ops/fleet/health(defined atsrc/backend/routers/ops.py:123, wrapped bysrc/mcp-server/src/tools/monitoring.ts:42)
Steps to reproduce
- Call
mcp__trinity__list_agents→ 9 running agents returned ✅ - Call
mcp__trinity__get_fleet_health→500 Internal Server Error❌ - Call
mcp__trinity__get_agent_healthfor each of the 9 agents → all returnsuccess: true,aggregate_status: "healthy"✅
Likely root cause
The per-agent endpoint returns suspicious data that the fleet aggregator probably can't tolerate:
| Agent | last_check_at | uptime_24h | latency_24h |
|---|---|---|---|
| competitor-analyzer | 2026-05-05 (today) | 100 | 30.33ms |
| atlas | 2026-03-19 | null | null |
| tom-marketing-ops | 2026-04-28 | null | null |
| bdr-agent | 2026-04-28 | null | null |
| rsdr-agent | 2026-03-04 | null | null |
| ability-website | 2026-02-28 | null | null |
| ruby-internal | 2026-02-23 | null | null |
| cornelius-internal | 2026-02-23 | null | null |
| source-of-truth | 2026-02-23 | null | null |
8 of 9 agents have uptime_percent_24h: null and avg_latency_24h_ms: null, and last_check_at is days-to-months old. The scheduled fleet health check loop appears to have stopped running for those agents — only competitor-analyzer has fresh data.
Two related issues:
- The scheduled check is not running for most agents. This is the underlying problem.
perform_fleet_health_checkinsrc/backend/services/monitoring_service.py:528should be refreshing all running agents on a schedule. - The aggregator endpoint crashes on null/stale 24h values instead of degrading gracefully. Even when stale data exists, the response should be a structured payload (e.g.
aggregate_status: "unknown"), not 500.
Workaround
Loop over list_agents and call get_agent_health per agent, or call trigger_health_check(agent_name) per agent to refresh data on demand.
Doc drift noticed in passing (not blocking)
While investigating I noticed three different paths cited for fleet health across docs:
docs/user-docs/operations/monitoring.md→/api/monitoring/fleet-healthdocs/memory/feature-flows/agent-monitoring.md→/api/monitoring/status- Actual implementation →
/api/ops/fleet/health
Worth reconciling once the bug is fixed.
Asks
- Wrap fleet aggregation in error handling so null/missing 24h rollups degrade to
unknowninstead of 500 - Investigate why
perform_fleet_health_checkstopped running for 8 of 9 agents (check scheduler logs around 2026-02-23 — that's when the stalest agents were last refreshed) - Optional: reconcile fleet-health endpoint paths across docs
Activity
fix(monitoring): degrade fleet-status to 'unknown' instead of 500 on …
fix(monitoring): health-check the whole fleet, not just running agents (
vybe commentedon Jun 1, 2026
Shipped in v0.6.0 (released via #998).
Release: v0.6.1 (#1171)
chore(enterprise): bump the private module to trinity-enterprise#669 (A…
feat(assignments): go live — un-fence get_agent_assignments, fail-clo…