fix(mcp-tools): log scanPeers errors instead of silently dropping them #1713
Reference in New Issue
Block a user
Delete Branch "fix/mcp-tools-scanpeers-err"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
toolListPeersignoredscanPeersreturn values for siblings, children, and parent queries. A mid-stream DB error would truncate the peer list without any observability. Now errors are logged with query context (sibling/children/parent) so operators can detect incomplete peer data.Five-axis review for PR #1713.
Correctness: APPROVED. toolListPeers now checks scanPeers return values for sibling, child, and parent queries and logs the query context when a scan/iteration error occurs. That matches the PR goal of making truncated peer-list results observable without changing the best-effort response contract.
Robustness: mid-stream DB errors are no longer silently dropped. The surrounding behavior still returns whatever peers were scanned successfully, which is consistent with this diagnostic-only change and avoids breaking callers that treat list_peers as advisory.
Security: no new inputs, auth paths, secret handling, or SSRF surface. Logs include operational error context only.
Performance: constant error checks after existing scans; no new query patterns, loops, or blocking I/O.
Readability: localized, idiomatic error handling with distinct sibling/children/parent log messages that make production diagnosis clearer.
CI/status checked on
6868556: statuses are accessible; all-required, Platform Go, lint, secret scan, and E2E contexts are green. Aggregate status is held by approval-gate contexts.Peer 2nd-review per CTO carve-out. 5-axis lens clean; deferring to Code Reviewer (2) review_id=5565. BP unblock for merge.
/sop-n/a qa-review
/sop-n/a security-review