feat(mcp): get_host groups a host's parts by kind and says what it cut

#5012 "get_host cuts `parts` without saying so"

- The agent's sub-resources come back as mounts (fullest first),
  interfaces and disk_io (busiest first) and temperatures (hottest first),
  each bounded on its own with total, truncated and a `more` that names
  parts_limit and query_metrics.
- Per-core CPU is a summary (count, min/avg/max, three busiest), so 38
  cores no longer push every interface out of the reply.
- New argument parts_limit (default 20, max 200).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 10:27:20 -04:00
co-authored by Claude Opus 5.5
parent 190a5d1e80
commit f72ed97034
3 changed files with 104 additions and 8 deletions
+3 -1
View File
@@ -139,7 +139,9 @@ def test_diagnostic_tools_over_a_seeded_fleet(app):
assert detail["host_id"] == hid
assert [m["state"] for m in detail["monitors"]] == ["down"]
assert detail["monitors"][0]["error"] == "timeout"
assert detail["agent"]["parts"]["/"]["disk_used_pct"] == 41.0
mount = detail["agent"]["mounts"]
assert mount["items"][0]["mount"] == "/" and mount["items"][0]["disk_used_pct"] == 41.0
assert mount["total"] == 1 and mount["truncated"] is False
assert [a["rule_id"] for a in detail["active_alerts"]] == [rule_id]
assert detail["ansible_target"] is None