#19102: Fix Telegram per-message link preview override
channel: telegram
agents
size: XS
trusted-contributor
Cluster:
Telegram Streaming Enhancements
## Description
Telegram's sendMessage defaults to the account-level `linkPreview` setting, ignoring per-message overrides requested via the tool interface.
## Fix
- Added `linkPreview` parameter reading in `telegram-actions.ts` and pass it through to `sendMessageTelegram`
- Added `linkPreview` to the `TelegramSendOpts` type
- Updated priority chain: per-message > account config > default (enabled)
This is a minimal, targeted fix extracted from a previous multi-feature PR (#18224).
## AI Transparency
- **Assisted by**: OpenClaw Agent (Claude Opus)
- **Testing level**: Type check verification
- **Prompt strategy**: Extracted targeted fix from multi-feature PR
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds per-message `linkPreview` override support to Telegram's `sendMessage` action, fixing an issue where the account-level setting couldn't be overridden for individual messages.
**Changes made:**
- Added `linkPreview` parameter reading in `telegram-actions.ts` (line 190)
- Passed the parameter through to `sendMessageTelegram` (line 207)
- Added `linkPreview` to the `TelegramSendOpts` type definition (line 64 in `send.ts`)
- Implemented proper priority chain: per-message > account config > default (enabled) on line 472
**Issue found:**
- The `linkPreview` parameter is missing from the tool schema definition in `message-tool.ts` (around line 196), which means agents won't have visibility into this parameter through the schema. The parameter will work at runtime since it's read directly from params, but it won't be documented in the tool interface.
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with one minor schema definition issue that should be addressed
- The implementation is clean and correct, with proper type safety and a well-implemented priority chain. The code follows existing patterns and doesn't introduce security vulnerabilities. However, the missing tool schema definition means agents won't have formal visibility into the new parameter, which reduces the score from 5 to 4. The functionality will work at runtime, but the schema incompleteness is a gap in the API contract.
- Pay attention to `src/agents/tools/message-tool.ts` - needs the `linkPreview` parameter added to the schema definition (around line 196)
<sub>Last reviewed commit: decbe33</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#22763: feat: expose per-message linkPreview param in message tool
by chrysb · 2026-02-21
87.2%
#20842: fix(telegram): preserve preview when only error payloads are delivered
by marcodelpin · 2026-02-19
80.0%
#19869: feat(telegram): add disableWebPagePreview option
by bip-bup-bip-bup · 2026-02-18
79.3%
#14443: fix(telegram): skip General topic thread ID for all chat types (#14...
by lailoo · 2026-02-12
77.8%
#8753: fix(telegram): add config option to disable acknowledgments
by revenuestack · 2026-02-04
77.6%
#19375: telegram: align tool-error summaries
by NorthyIE · 2026-02-17
77.5%
#9734: fix(telegram): correct sender identification for channel messages (...
by divol89 · 2026-02-05
76.7%
#12936: fix(telegram): omit message_thread_id for private DM chats
by omair445 · 2026-02-09
76.7%
#19399: telegram: fix MEDIA false positives and partial final drop
by HOYALIM · 2026-02-17
76.6%
#18678: fix(telegram): preserve draft message when all final payloads are e...
by julianubico · 2026-02-16
76.6%