test(telegram): cover autoSelectFamily env precedence

This commit is contained in:
Sebastian
2026-02-17 10:09:39 -05:00
parent 9f261f592d
commit e7c19cb52d
2 changed files with 25 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ Docs: https://docs.openclaw.ai
- Telegram: ignore `<media:...>` 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.

View File

@@ -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: {},