mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-28 14:07:55 +00:00
Closes #459. Reported by @jasonftl with a precise smoking gun: incoming ChannelMessage has channel="discord" (TYPE label) and conversation_id=<numeric channel id>, but the reply code was using cm.channel as the destination — Discord saw /channels/discord/messages and 404'd silently, blackholing every reply. The bug was two field-mappings in channel_agent.py:_process_message (the happy path + the exception path): self._channel.send( msg.channel, # WRONG — TYPE label reply, conversation_id=msg.conversation_id, # WRONG — channel id used as msg-ref-id ) The existing DiscordChannel.send() contract — proved by the existing test_send_with_conversation_id test — is: - first positional `channel` = native destination ID (Discord channel id) - `conversation_id` kwarg = native message ID for reply threading Fix: swap both fields to the correct ones from ChannelMessage: self._channel.send( msg.conversation_id, # Discord channel id reply, conversation_id=msg.message_id, # message id for threading ) Plus a defensive guard in discord_channel.py: when channel is empty, refuse fast with a clear warning instead of POSTing to /channels//messages and silently 404'ing. 3 new tests, 38 affected pass. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>