mirror of
https://github.com/open-webui/computer.git
synced 2026-11-05 01:17:24 +00:00
[GH-ISSUE #264] bug: messaging bridge drops final replies on send-only platforms (WhatsApp Cloud API) #177
Labels
No labels
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/computer#177
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @1-kabir on GitHub (Sep 5, 2026).
Original GitHub issue: https://github.com/open-webui/computer/issues/264
Bug description
When a bot is configured on a platform whose API cannot edit sent messages (WhatsApp via the Meta Cloud API), the messaging bridge processes inbound messages and runs the agent task correctly, but the final reply is never delivered. The user only ever receives the initial "Thinking..." placeholder message. The reply text exists in the cptr chat thread — only the platform-side delivery is missing, and the failure is logged at DEBUG level only, so it is invisible in normal operation.
Root cause
cptr/utils/bridge.py→_stream_loop()implements reply delivery with an edit-based model: it sends a placeholder message, streams progress viaadapter.edit(), and delivers the final response viaadapter.edit()on that placeholder.WhatsApp Cloud API is send-only — the Messages API exposes exactly one endpoint (
POST /{Phone-Number-ID}/messages); sent messages cannot be edited (Meta's "edit messages" docs cover inbound user-edit webhook events only).WhatsAppAdapter.edit()is therefore a no-op. Since the placeholder send always succeeds, the send-based fallback branch (reachable only when there is noplatform_msg_id) never runs, so the final edit silently drops every normal-length reply.Two related defects in the same code path:
break, so everything after the first chunk is silently discarded.edit()directly, which is also a no-op on send-only platforms.WhatsAppAdapter.send_typing()posts a hardcoded fakemessage_id; the Cloud API requires the real inboundwamidfrom the messages webhook for the read-receipt/typing-indicator endpoint. Because the bridge callssend_typing()each poll iteration, every agent run produces a burst of 400s (exception swallowed).To Reproduce
platform: "whatsapp"and a validaccess_token|phone_number_idtoken, with an allowed sender.Expected behavior
send()(in chunks), with no placeholder message (it could never be updated in place).POST /{phone_number_id}/messageswith{"messaging_product": "whatsapp", "status": "read", "message_id": "<inbound wamid>", "typing_indicator": {"type": "text"}}(requires Graph API ≥ v23.0; the indicator auto-dismisses after 25 seconds or on reply, so periodic refresh is intended usage). This requires tracking the last inboundmessage.idfrom the webhook payload.Suggested approach
BaseAdapter(e.g.supports_edit, defaultTrue;WhatsAppAdaptersetsFalse)._dispatch_task: skip the placeholder when the adapter cannot edit._stream_loop: when the adapter cannot edit, skip streaming edits entirely, refresh the typing indicator each poll, and deliver the final reply viaadapter.send()chunks (also fixing the overflowbreakand the empty-reply branch).send()instead of dropping the reply.API_BASEto v23.0 (first GA version with typing indicators), implement the real typing indicator, track the last inbound message id from the webhook, and surface interactive button/list replies (currently dropped silently) as plain text.Additional context
Environment
@owui-terminator[bot] commented on GitHub (Sep 5, 2026):
🔍 Related Issues Found
I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:
This issue is in the same streaming/delivery path and reports incorrect end-of-response handling. While it is about repeated output rather than WhatsApp delivery, it is the closest related issue found around stream termination in the bridge.
by JKGeovision
💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.
This comment was generated automatically. React with 👍 if helpful, 👎 if not.
@1-kabir commented on GitHub (Sep 5, 2026):
Update: this is implemented and tested on a fork (1-kabir/computer, branch
fix/whatsapp-bridge-delivery, merged to itsmain) in case the approach is useful as a reference:BaseAdapter.supports_editcapability flag; send-only platforms skip the placeholder and streaming edits entirelysend()chunks (also fixes the multi-chunk overflowbreakand the empty-reply branch)send()instead of dropping the replywamid+typing_indicator: {"type": "text"})logger.exceptioninstead of DEBUG-only15 tests covering the adapter and bridge loop ship with it. No PR will be opened against this repo per its contribution policy — sharing in case the maintainers want to implement it here.