Conversation
PR #95740 — fix(telegram): preserve replied voice-note semantics for STT Diff evidence ( What it does: In Reviewed:
Non-blocking nits:
No security impact. Minimal, targeted fix. Verdict: Approve — LGTM. |
34ff934 to
79f61d0
Compare
|
Rebased onto current
Tests: |
|
Exact-head KEEP on #95740 head 79f61d0. KEEP remapping a cached replied Telegram voice note from MessageType.AUDIO back to VOICE when the replied message was a native voice note, so automatic STT runs (gateway STTs VOICE, skips AUDIO). KEEP adapter change in CHECK: plain audio-file replies stay AUDIO (no forced STT). CHECK: group gating tests still pass. Author djagya not kvnloo. No competing PR. |
Keep native replied Telegram voice notes as VOICE so the gateway STT pipeline sees them; generic replied audio files stay AUDIO. Rebuilt for PR NousResearch#95740 on 5910de2: the upstream KEEP head (79f61d0) sits 2522 commits behind current main, so these are independently justified bytes at the drifted seam, not a cherry-pick. Co-authored-by: Cursor <cursoragent@cursor.com>
79f61d0 to
e3d34a2
Compare
Keep native replied Telegram voice notes as VOICE so the gateway STT pipeline sees them; generic replied audio files stay AUDIO. Rebuilt for PR NousResearch#95740 on 5910de2: the upstream KEEP head (79f61d0) sits 2522 commits behind current main, so these are independently justified bytes at the drifted seam, not a cherry-pick. Co-authored-by: Cursor <cursoragent@cursor.com>
e3d34a2 to
04a7a01
Compare
Keep native replied Telegram voice notes as VOICE so the gateway STT pipeline sees them; generic replied audio files stay AUDIO. Rebuilt for PR NousResearch#95740 on 5910de2: the upstream KEEP head (79f61d0) sits 2522 commits behind current main, so these are independently justified bytes at the drifted seam, not a cherry-pick. Co-authored-by: Cursor <cursoragent@cursor.com>
04a7a01 to
dee21b8
Compare
What does this PR do?
When a Telegram text message replies to a voice note,
_cache_replied_media()stores the media through_attach_cached. Cached audio is mapped via_CACHED_KIND_TO_MESSAGE_TYPE, which always yieldsMessageType.AUDIO.The gateway runs automatic STT for
VOICEand skipsAUDIO. A replied-to native voice note therefore arrives as an audio file instead of entering STT.This change remaps a cached
audiokind back toMessageType.VOICEwhen the replied Telegram message is a native voice note. Generic replied audio files stayMessageType.AUDIO.Related Issue
No tracking issue.
Related prior work: #18887 closed after replied-to media caching landed; the remaining gap is this classification. This PR does not overlap #86040 (reply anchoring after transcript echo) or #94007 (keeping an audio reference after successful STT). It acts earlier, when replied Telegram media is classified for the gateway.
Type of Change
Changes Made
plugins/platforms/telegram/adapter.py— after_attach_cached, ifcached.kind == "audio"andreply_msg.voiceis set, setMessageType.VOICE.tests/gateway/test_telegram_group_gating.py— replied voice notes enter gateway STT; replied audio files do not.How to Test
Focused regressions (this rebase, macOS 26 / Python 3.11 via uv):
Result: 2 passed.
Lint the changed files:
Result:
All checks passed!Manual: reply to a Telegram voice note with text; the gateway should treat the attachment as STT input. Reply to a regular audio file; it should stay a non-STT audio attachment.
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass — focused affected suite only; full suite not runDocumentation & Housekeeping
docs/, docstrings) — N/Acli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
N/A. Classification is pinned by the two regressions above.