You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
diagnostics/healthCheck report success for unknown or unreachable nodes #92
The self-test and diagnostics tools report success when the node is unknown, unreachable, or rejects auth, and malformed HOMELAB_NODES JSON is silently ignored. The real cause is never shown.
Each sub-check catches every error, replaces it with "(unavailable)", "not available", or "Failed to query", and never sets isError. Errors swallowed this way include SSHError for an unknown node, SSHAuthError, and SSHConnectionError.
getNodesRegistry swallows JSON parse errors.
Entries without host become host: "".
Impact
A mistyped node name, bad credentials, or broken HOMELAB_NODES produces "0/7 checks passed" or nine "(unavailable)" sections with no explanation, which defeats the purpose of a diagnostics tool.
With an unreachable host, each sub-check waits for the connect timeout in turn.
Steps to reproduce
Call homelab_diagnostics {node: "typo"} or homelab_healthCheck {node: "typo"}.
Set HOMELAB_NODES to invalid JSON and call any tool with node: "nas". The result is "Unknown node" with no parse hint.
Suggested fix
Run one initial connectivity probe without catching, and return errorResponse if it fails.
Include the error message in each failed check's detail.
Parse HOMELAB_NODES once with a zod schema, log parse errors to stderr, require host, and mention the parse failure in the "Unknown node" error.
Acceptance criteria
Unknown node and auth failure return isError: true with the cause
Failed checks include the reason
Invalid HOMELAB_NODES produces a clear error
Tests cover each case
Getting started
Relevant files: the files listed above
How to run tests: cd mcp-server && npm test
Filed by repo-audit/full-audit at 9cfe5e3. Severity: medium. Effort: S. audit-key: bug|mcp-server/src/tools/diagnostics.ts|collect
Activity