Skip to content

fix(telegram): enable voice-note transcription in DMs#61008

Merged
obviyus merged 2 commits into
openclaw:mainfrom
manueltarouca:fix/telegram-dm-voice-transcription
Apr 5, 2026
Merged

fix(telegram): enable voice-note transcription in DMs#61008
obviyus merged 2 commits into
openclaw:mainfrom
manueltarouca:fix/telegram-dm-voice-transcription

Conversation

@manueltarouca

Copy link
Copy Markdown
Contributor

Summary

  • Restore DM voice-note transcription lost during the src/telegram/ to extensions/telegram/ migration
  • The preflight transcription condition was gated on isGroup && requireMention, so voice notes in direct messages were never transcribed and arrived as raw <media:audio> placeholders
  • Widen the condition to fire whenever there is audio and no text, regardless of chat type, while preserving group-specific guards (requireMention, disableAudioPreflight, senderAllowedForAudioPreflight)

Original fix: c15385f, regression introduced during extension refactor.

Test plan

  • New test: DM voice note triggers preflight transcription
  • Existing group transcription tests still pass
  • Existing audio-transcript integration tests pass
  • pnpm tsgo passes
  • Manual: send a voice note in a Telegram DM, confirm transcript replaces <media:audio>

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: S labels Apr 4, 2026
@greptile-apps

greptile-apps Bot commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes DM voice-note transcription that was accidentally dropped during the src/telegram/extensions/telegram/ migration. The old needsPreflightTranscription condition required isGroup && requireMention, which permanently excluded private chats; the fix restructures the condition to hasAudio && !hasUserText && (!isGroup || <group guards>) so DMs transcribe unconditionally while all group-specific guards (requireMention, mentionRegexes, disableAudioPreflight, senderAllowedForAudioPreflight) remain intact. A targeted new test covers the DM path.

Confidence Score: 5/5

Safe to merge — precise two-line logic change with a matching test, no regressions in existing group cases.

The fix is minimal and well-targeted: it restores a documented regression, the condition restructuring is logically equivalent for groups and correct for DMs, and the new test exercises the exact broken path. All remaining findings are P2 or lower.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(telegram): enable voice-note transcr..." | Re-trigger Greptile

@manueltarouca
manueltarouca force-pushed the fix/telegram-dm-voice-transcription branch from 0147b8d to 59aa0a7 Compare April 4, 2026 18:54
@manueltarouca

Copy link
Copy Markdown
Contributor Author

CI failures are unrelated to this change -- all stem from ReferenceError: Cannot access '__vite_ssr_import_9__' before initialization in src/plugin-sdk/facade-runtime.ts:76, a Vite SSR circular import issue that affects the entire Telegram extension test suite. This PR touches only bot-message-context.body.ts and its colocated test.

The check job type errors (registerVideoGenerationProvider / videoGenerationProviders) are also pre-existing on adjacent commits.

@obviyus obviyus self-assigned this Apr 5, 2026
manueltarouca and others added 2 commits April 5, 2026 09:47
The preflight transcription condition only triggered for group chats
(isGroup && requireMention), so voice notes sent in direct messages
were never transcribed -- they arrived as raw <media:audio> placeholders.

This regression was introduced when the Telegram channel was moved from
src/telegram/ to extensions/telegram/, losing the fix from c15385f.

Widen the condition to fire whenever there is audio and no accompanying
text, regardless of chat type. Group-specific guards (requireMention,
disableAudioPreflight, senderAllowedForAudioPreflight) still apply
only in group contexts.
@obviyus
obviyus force-pushed the fix/telegram-dm-voice-transcription branch from 990cc24 to b83de68 Compare April 5, 2026 04:18

@obviyus obviyus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed latest changes; landing now.

@obviyus
obviyus merged commit bf0f4d9 into openclaw:main Apr 5, 2026
25 of 26 checks passed
@obviyus

obviyus commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Landed on main.

Thanks @manueltarouca.

@vincentkoc vincentkoc added the dedupe:parent Primary canonical item in dedupe cluster label Apr 25, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…hanks @manueltarouca)

* fix(telegram): enable voice-note transcription in DMs

The preflight transcription condition only triggered for group chats
(isGroup && requireMention), so voice notes sent in direct messages
were never transcribed -- they arrived as raw <media:audio> placeholders.

This regression was introduced when the Telegram channel was moved from
src/telegram/ to extensions/telegram/, losing the fix from eb56ced.

Widen the condition to fire whenever there is audio and no accompanying
text, regardless of chat type. Group-specific guards (requireMention,
disableAudioPreflight, senderAllowedForAudioPreflight) still apply
only in group contexts.

* fix: restore Telegram DM voice-note transcription (openclaw#61008) (thanks @manueltarouca)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…hanks @manueltarouca)

* fix(telegram): enable voice-note transcription in DMs

The preflight transcription condition only triggered for group chats
(isGroup && requireMention), so voice notes sent in direct messages
were never transcribed -- they arrived as raw <media:audio> placeholders.

This regression was introduced when the Telegram channel was moved from
src/telegram/ to extensions/telegram/, losing the fix from a9137f9.

Widen the condition to fire whenever there is audio and no accompanying
text, regardless of chat type. Group-specific guards (requireMention,
disableAudioPreflight, senderAllowedForAudioPreflight) still apply
only in group contexts.

* fix: restore Telegram DM voice-note transcription (openclaw#61008) (thanks @manueltarouca)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…hanks @manueltarouca)

* fix(telegram): enable voice-note transcription in DMs

The preflight transcription condition only triggered for group chats
(isGroup && requireMention), so voice notes sent in direct messages
were never transcribed -- they arrived as raw <media:audio> placeholders.

This regression was introduced when the Telegram channel was moved from
src/telegram/ to extensions/telegram/, losing the fix from cbe04c0.

Widen the condition to fire whenever there is audio and no accompanying
text, regardless of chat type. Group-specific guards (requireMention,
disableAudioPreflight, senderAllowedForAudioPreflight) still apply
only in group contexts.

* fix: restore Telegram DM voice-note transcription (openclaw#61008) (thanks @manueltarouca)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
…hanks @manueltarouca)

* fix(telegram): enable voice-note transcription in DMs

The preflight transcription condition only triggered for group chats
(isGroup && requireMention), so voice notes sent in direct messages
were never transcribed -- they arrived as raw <media:audio> placeholders.

This regression was introduced when the Telegram channel was moved from
src/telegram/ to extensions/telegram/, losing the fix from cbe04c0.

Widen the condition to fire whenever there is audio and no accompanying
text, regardless of chat type. Group-specific guards (requireMention,
disableAudioPreflight, senderAllowedForAudioPreflight) still apply
only in group contexts.

* fix: restore Telegram DM voice-note transcription (openclaw#61008) (thanks @manueltarouca)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
Nachx639 pushed a commit to Nachx639/clawdbot that referenced this pull request Jun 17, 2026
…hanks @manueltarouca)

* fix(telegram): enable voice-note transcription in DMs

The preflight transcription condition only triggered for group chats
(isGroup && requireMention), so voice notes sent in direct messages
were never transcribed -- they arrived as raw <media:audio> placeholders.

This regression was introduced when the Telegram channel was moved from
src/telegram/ to extensions/telegram/, losing the fix from 38d8c93.

Widen the condition to fire whenever there is audio and no accompanying
text, regardless of chat type. Group-specific guards (requireMention,
disableAudioPreflight, senderAllowedForAudioPreflight) still apply
only in group contexts.

* fix: restore Telegram DM voice-note transcription (openclaw#61008) (thanks @manueltarouca)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram dedupe:parent Primary canonical item in dedupe cluster size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants