fix(telegram): enable autoSelectFamily by default for Node.js 22+

Fixes issue where Telegram fails to send messages when IPv6 is configured
but not functional on the network.

Problem:
- Many networks (especially in Latin America) have IPv6 configured but
  not properly routed by ISP/router
- Node.js tries IPv6 first, gets 'Network is unreachable' error
- With autoSelectFamily=false, Node doesn't fallback to IPv4
- Result: All Telegram API calls fail

Solution:
- Change default from false to true for Node.js 22+
- This enables automatic IPv4 fallback when IPv6 fails
- Config option channels.telegram.network.autoSelectFamily still available
  for users who need to override

Symptoms fixed:
- Health check: Telegram | WARN | failed (unknown) - fetch failed
- Logs: Network request for 'sendMessage' failed
- Bot receives messages but cannot send replies

Tested on:
- macOS 26.2 (Sequoia)
- Node.js v22.15.0
- OpenClaw 2026.2.12
- Network with IPv6 configured but not routed
This commit is contained in:
Ignacio
2026-02-16 14:14:22 -03:00
committed by Peter Steinberger
parent 3ec936d1b4
commit c762bf71f6

View File

@@ -32,7 +32,7 @@ export function resolveTelegramAutoSelectFamilyDecision(params?: {
return { value: params.network.autoSelectFamily, source: "config" };
}
if (Number.isFinite(nodeMajor) && nodeMajor >= 22) {
return { value: false, source: "default-node22" };
return { value: true, source: "default-node22" };
}
return { value: null };
}