fix(matrix): accept is_voice kwarg in send_voice to match base class contract - #100679
hermes-gadget wants to merge 1 commit into
Conversation
|
🦀 Krab review: Nice root-cause fix—small, contract-correct, and directly tied to the observed |
…contract The base class delivery loop passes is_voice= to adapter.send_voice(), but the Matrix adapter's send_voice() did not accept that keyword argument. This caused a TypeError that silently dropped all audio/TTS attachments on Matrix. Added is_voice: bool = False to the Matrix adapter's send_voice() signature. The parameter is unused internally since the Matrix adapter handles voice transcoding independently — it just needs to accept the kwarg without crashing. Rebased onto main after NousResearch#102117 codebase simplification refactor.
228589d to
0c6677f
Compare
Rebased onto current main after #102117This PR was originally opened against the pre-refactor codebase. After the massive codebase simplification in #102117 (436K additions / 784K deletions across 2,655 files), the old branch had thousands of conflicts and was stale. What changed: async def send_voice(
self, chat_id: str, audio_path: str, caption: Optional[str] = None, reply_to: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
is_voice: bool = False) -> SendResult:Why the fix is still needed: result = await self.send_voice(chat_id=chat_id, audio_path=path, metadata=metadata, is_voice=is_voice)The Matrix adapter inherits |
Summary
The base class delivery loop passes
is_voice=toadapter.send_voice(), but the Matrix adapter'ssend_voice()did not accept that keyword argument. This caused aTypeErrorthat silently dropped all audio/TTS attachments on Matrix.Root Cause
Gateway logs showed:
The base class at
gateway/run.py:24328calls:But the Matrix adapter's
send_voice()signature lacked theis_voiceparameter.Fix
Added
is_voice: bool = Falseto the Matrix adapter'ssend_voice()signature. The parameter is unused internally since the Matrix adapter handles voice transcoding (to Ogg/Opus for MSC3245) independently — it just needs to accept the kwarg without crashing.Test Plan