From e7c19cb52d6b5a4c6c0beb2cca6e052eb4f8ba8c Mon Sep 17 00:00:00 2001 From: Sebastian <19554889+sebslight@users.noreply.github.com> Date: Tue, 17 Feb 2026 10:09:39 -0500 Subject: [PATCH] test(telegram): cover autoSelectFamily env precedence --- CHANGELOG.md | 1 + src/telegram/network-config.test.ts | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72a97a7c8b..77d1d3ff73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ Docs: https://docs.openclaw.ai - Telegram: ignore `` placeholder lines when extracting `MEDIA:` tool-result paths, preventing false local-file reads and dropped replies. (#18510) Thanks @yinghaosang. - Telegram: skip retries when inbound media `getFile` fails with Telegram's 20MB limit and continue processing message text, avoiding dropped messages for oversized attachments. (#18531) Thanks @brandonwise. - Telegram: clear stored polling offsets when bot tokens change or accounts are deleted, preventing stale offsets after token rotations. (#18233) +- Telegram: enable `autoSelectFamily` by default on Node.js 22+ so IPv4 fallback works on broken IPv6 networks. (#18272) Thanks @nacho9900. - Auto-reply/TTS: keep tool-result media delivery enabled in group chats and native command sessions (while still suppressing tool summary text) so `NO_REPLY` follow-ups do not drop successful TTS audio. (#17991) Thanks @zerone0x. - Agents/Tools: deliver tool-result media even when verbose tool output is off so media attachments are not dropped. (#16679) - Discord: optimize reaction notification handling to skip unnecessary message fetches in `off`/`all`/`allowlist` modes, streamline reaction routing, and improve reaction emoji formatting. (#18248) Thanks @thewilloftheshadow and @victorGPT. diff --git a/src/telegram/network-config.test.ts b/src/telegram/network-config.test.ts index c9ffe30d8c..be89b5ea8e 100644 --- a/src/telegram/network-config.test.ts +++ b/src/telegram/network-config.test.ts @@ -27,6 +27,30 @@ describe("resolveTelegramAutoSelectFamilyDecision", () => { }); }); + it("prefers env enable over config", () => { + const decision = resolveTelegramAutoSelectFamilyDecision({ + env: { OPENCLAW_TELEGRAM_ENABLE_AUTO_SELECT_FAMILY: "1" }, + network: { autoSelectFamily: false }, + nodeMajor: 22, + }); + expect(decision).toEqual({ + value: true, + source: "env:OPENCLAW_TELEGRAM_ENABLE_AUTO_SELECT_FAMILY", + }); + }); + + it("prefers env disable over config", () => { + const decision = resolveTelegramAutoSelectFamilyDecision({ + env: { OPENCLAW_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY: "1" }, + network: { autoSelectFamily: true }, + nodeMajor: 22, + }); + expect(decision).toEqual({ + value: false, + source: "env:OPENCLAW_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY", + }); + }); + it("uses config override when provided", () => { const decision = resolveTelegramAutoSelectFamilyDecision({ env: {},