Skip to content

feat(telegram): add disableAudioPreflight config for groups and topics#23067

Merged
steipete merged 2 commits intoopenclaw:mainfrom
yangnim21029:feat/telegram-audio-preflight
Mar 2, 2026
Merged

feat(telegram): add disableAudioPreflight config for groups and topics#23067
steipete merged 2 commits intoopenclaw:mainfrom
yangnim21029:feat/telegram-audio-preflight

Conversation

@yangnim21029
Copy link

@yangnim21029 yangnim21029 commented Feb 22, 2026

Summary

Add a disableAudioPreflight configuration option for Telegram groups and topics.

Currently, OpenClaw automatically transcribes voice notes in groups where a mention is required to detect if the bot was addressed. This can lead to unintended API costs in busy groups. This PR allows bot owners to opt-out of this behavior.

Changes

  • Configuration: Added disableAudioPreflight?: boolean to TelegramTopicConfig and TelegramGroupConfig in src/config/types.telegram.ts.
  • Logic: Updated buildTelegramMessageContext in src/telegram/bot-message-context.ts to skip preflight transcription if disableAudioPreflight is set to true.
  • Tests: Added a unit test in src/telegram/bot-message-context.audio-transcript.test.ts to verify that transcription is skipped when the flag is enabled.

Verification

  • Ran pnpm test src/telegram/bot-message-context.audio-transcript.test.ts - PASS
  • Verified that transcribeFirstAudio is not called when the config is active.

Greptile Summary

Added disableAudioPreflight configuration option for Telegram groups and topics to allow bot owners to opt-out of automatic voice-note transcription for mention detection, preventing unintended API costs in busy groups.

  • Config fields added to TelegramTopicConfig and TelegramGroupConfig in src/config/types.telegram.ts:179 and src/config/types.telegram.ts:200
  • Logic updated in buildTelegramMessageContext to skip preflight transcription when flag is enabled using existing firstDefined pattern for config resolution
  • Test coverage added to verify transcription is skipped when config is active

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Clean implementation that follows existing codebase patterns consistently, includes test coverage, and solves a well-defined problem without introducing new dependencies or side effects
  • No files require special attention

Last reviewed commit: 1156030

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@openclaw-barnacle openclaw-barnacle bot added channel: telegram Channel integration: telegram size: S labels Feb 22, 2026
@openclaw-barnacle
Copy link

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added the stale Marked as stale due to inactivity label Feb 28, 2026
@steipete steipete force-pushed the feat/telegram-audio-preflight branch from 1156030 to b142cc3 Compare March 2, 2026 22:26
@steipete steipete merged commit 1fa2488 into openclaw:main Mar 2, 2026
@steipete
Copy link
Contributor

steipete commented Mar 2, 2026

Landed via temp rebase onto main.

  • Gate: pnpm test src/telegram/bot-message-context.audio-transcript.test.ts src/config/config.telegram-audio-preflight.test.ts (pass); pnpm test src/config/schema.help.quality.test.ts (pass); pnpm check (still blocked by unrelated existing type errors in extensions/zalouser and src/gateway/server-reload-handlers.ts)
  • Land commit: b142cc3
  • Merge commit: 1fa2488

Thanks @yangnim21029!

@openclaw-barnacle openclaw-barnacle bot added the docs Improvements or additions to documentation label Mar 2, 2026
dawi369 pushed a commit to dawi369/davis that referenced this pull request Mar 3, 2026
OWALabuy pushed a commit to kcinzgg/openclaw that referenced this pull request Mar 4, 2026
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram docs Improvements or additions to documentation size: S stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants