openclaw - 💡(How to fix) Fix Bug: channels.telegram.linkPreview: false silently ignored due to ?? precedence bug [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Setting channels.telegram.linkPreview: false in openclaw.json does not actually disable link previews in Telegram. The bug is a JavaScript operator precedence issue in the compiled delivery code.

Root Cause

In dist/send-HzJbRmiM.js (compiled):

const linkPreviewOptions = account.config.linkPreview ?? true ? void 0 : { is_disabled: true };

Because ?? has lower precedence than ?:, this evaluates as:

(account.config.linkPreview ?? (true ? void 0 : { is_disabled: true }))

When linkPreview is false:

  1. false ?? void 0 → returns false (the actual value, not the fallback)
  2. false is falsy, so if (linkPreviewOptions) never executes
  3. No link_preview_options is passed to Telegram at all
  4. Telegram defaults to showing previews → previews are NOT disabled

Fix Action

Fixed

Code Example

const linkPreviewOptions = account.config.linkPreview ?? true ? void 0 : { is_disabled: true };

---

(account.config.linkPreview ?? (true ? void 0 : { is_disabled: true }))

---

const linkPreviewOptions = (account.config.linkPreview ?? true) ? void 0 : { is_disabled: true };

---

const linkPreviewOptions = account.config.linkPreview === false ? { is_disabled: true } : void 0;
RAW_BUFFERClick to expand / collapse

Bug Report: channels.telegram.linkPreview: false is silently ignored due to operator precedence bug

Version: OpenClaw 2026.5.22 (a374c3a)

Summary

Setting channels.telegram.linkPreview: false in openclaw.json does not actually disable link previews in Telegram. The bug is a JavaScript operator precedence issue in the compiled delivery code.

Root Cause

In dist/send-HzJbRmiM.js (compiled):

const linkPreviewOptions = account.config.linkPreview ?? true ? void 0 : { is_disabled: true };

Because ?? has lower precedence than ?:, this evaluates as:

(account.config.linkPreview ?? (true ? void 0 : { is_disabled: true }))

When linkPreview is false:

  1. false ?? void 0 → returns false (the actual value, not the fallback)
  2. false is falsy, so if (linkPreviewOptions) never executes
  3. No link_preview_options is passed to Telegram at all
  4. Telegram defaults to showing previews → previews are NOT disabled

Expected behavior

Setting linkPreview: false should send { link_preview_options: { is_disabled: true } } to Telegram.

Actual behavior

linkPreview: false is silently ignored. Previews still show.

Suggested fix

Add parentheses to fix precedence:

const linkPreviewOptions = (account.config.linkPreview ?? true) ? void 0 : { is_disabled: true };

Or more explicitly:

const linkPreviewOptions = account.config.linkPreview === false ? { is_disabled: true } : void 0;

Affected files (compiled dist/)

  • dist/send-HzJbRmiM.js
  • dist/delivery-DDhvFfD2.js (same pattern)

Related issues

  • #1675 — Feature: Add channels.telegram.linkPreview config option
  • #1806 — feat: Add option to disable Telegram link previews
  • #79679 — Telegram link previews unreliable with streamed/edited assistant replies

Note: This is distinct from #79679, which is about previews not showing when they should. This bug is about previews still showing when they shouldn't (when explicitly disabled in config).

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Setting linkPreview: false should send { link_preview_options: { is_disabled: true } } to Telegram.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING