Skip to content

fix(channels): Nextcloud Talk never delivers messages to the agent - #1289

Open
guzzi235 wants to merge 1 commit into
RightNow-AI:mainfrom
guzzi235:fix/nextcloud-talk-not-responding
Open

guzzi235 wants to merge 1 commit into
RightNow-AI:mainfrom
guzzi235:fix/nextcloud-talk-not-responding

Conversation

@guzzi235

Copy link
Copy Markdown

Summary

Two independent bugs combine to make the Nextcloud Talk channel receive messages but never forward them to the agent:

  1. Long-poll timeout race. The polling HTTP client used a 30s timeout, but Nextcloud's lookIntoFuture=1 long-poll can legitimately take up to ~30.7s to return when there are no new messages (measured directly against a real instance: HTTP_CODE:304 TIME:30.694274s). The client aborted just before the server replied, surfacing as a permanent error sending request on every poll cycle, for every room. Raised the timeout to 45s for headroom.

  2. Missing @mention support trips the group-chat filter. Every incoming message is constructed with is_group: true. The bridge's routing (bridge.rs) silently drops group messages that don't @mention the bot ("Ignoring group message ... not mentioned"), but the Nextcloud adapter never implements mention detection — so every message was dropped regardless of the timeout fix. Nextcloud Talk conversations used with this adapter are 1:1 bot<->operator rooms, so is_group: false matches actual usage and lets messages through.

Test plan

  • Verified end-to-end against a real Nextcloud Talk instance (self-hosted).
  • Without these two fixes: the bot authenticates and polls successfully but never responds to any message.
  • With both fixes applied: the bot responds reliably to messages sent in the room, confirmed over multiple send/reply cycles including after container restarts.

🤖 Generated with Claude Code

Two independent bugs combine to make the Nextcloud Talk channel
receive messages but never forward them:

1. The polling HTTP client used a 30s timeout, but Nextcloud's
   `lookIntoFuture=1` long-poll can legitimately take up to ~30.7s
   to return when there are no new messages (measured directly
   against a real instance). The client aborted just before the
   server replied, surfacing as a permanent `error sending request`
   on every poll cycle for every room. Raised to 45s for headroom.

2. Every incoming message is constructed with `is_group: true`,
   which triggers the bridge's mention-required filter for group
   chats (`bridge.rs`, "Ignoring group message ... not mentioned").
   The Nextcloud adapter never implements @mention detection, so
   every message was silently dropped regardless of the timeout fix.
   Nextcloud Talk conversations here are 1:1 bot<->operator rooms,
   so `is_group: false` matches the actual usage and lets messages
   through.

Verified end-to-end against a real Nextcloud Talk instance: without
these two fixes the bot never responds; with them, it responds
reliably to messages sent in a room.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant