fix(telegram): forward audioAsVoice flag in outbound adapter for voice bubbles#33056
fix(telegram): forward audioAsVoice flag in outbound adapter for voice bubbles#33056AnCoSONG wants to merge 1 commit intoopenclaw:mainfrom
Conversation
…e bubbles The Telegram outbound adapter sendPayload did not pass the audioAsVoice flag from the reply payload to the underlying sendMessageTelegram call. TTS correctly sets audioAsVoice=true but the flag was lost at the adapter boundary, causing voice messages to display as audio file cards instead of native voice bubbles. Closes openclaw#11654 Made-with: Cursor
Greptile SummaryThis PR fixes a one-line bug in the Telegram outbound adapter where the Fix ( Tests ( Backward compatibility: The change is backward-compatible; Confidence Score: 5/5
Last reviewed commit: 645e590 |
| ); | ||
| }); | ||
|
|
||
| it("does not set asVoice when audioAsVoice is absent", async () => { |
There was a problem hiding this comment.
The test name says "does not set asVoice", but the assertion on line 198 explicitly checks that asVoice: false is set. These are contradictory — the test verifies that asVoice defaults to false, not that it is absent.
A more accurate description would be:
| it("does not set asVoice when audioAsVoice is absent", async () => { | |
| it("sets asVoice to false when audioAsVoice is absent", async () => { |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/channels/plugins/outbound/telegram.test.ts
Line: 174
Comment:
The test name says "does not set `asVoice`", but the assertion on line 198 explicitly checks that `asVoice: false` **is** set. These are contradictory — the test verifies that `asVoice` defaults to `false`, not that it is absent.
A more accurate description would be:
```suggestion
it("sets asVoice to false when audioAsVoice is absent", async () => {
```
How can I resolve this? If you propose a fix, please make it concise.|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
audioAsVoice: trueon the reply payload, but the Telegram outbound adapter drops this flag, sosendMessageTelegramnever receivesasVoiceand defaults tosendAudioinstead ofsendVoice.asVoice: payload.audioAsVoice === truetopayloadOptsin the Telegram outbound adapter'ssendPayloadmethod, completing the data flow:payload.audioAsVoice->payloadOpts.asVoice->sendMessageTelegram(opts.asVoice)->resolveTelegramVoiceSend({ wantsVoice: true })-> TelegramsendVoiceAPI.sendMessageTelegraminternals. Only the adapter boundary is fixed.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Security Impact (required)
No)No)No— same Telegram API, justsendVoiceinstead ofsendAudio)No)No)Repro + Verification
Environment
Steps
Expected
Actual
asVoicepassthrough whenaudioAsVoice=trueand absence when not set.Evidence
Human Verification (required)
pnpm test src/channels/plugins/outbound/telegram.test.ts— 6/6 passaudioAsVoice=truepassesasVoice: true; absent/falseaudioAsVoicepassesasVoice: falseCompatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
src/channels/plugins/outbound/telegram.tsRisks and Mitigations
asVoice: trueif the upstream payload incorrectly setsaudioAsVoice.resolveTelegramVoiceSendalready checks voice compatibility (OGG/Opus, MP3, M4A) and falls back tosendAudiofor incompatible formats, with a log warning.Made with Cursor