mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 22:40:45 +08:00
feat(whatsapp): gate group replies on mention and share group sessions
Stop replying to every group message by filtering on @bot/triggers in the sidecar and gateway, and map group chats to one shared session while preserving per-sender identity. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
bc1b45a8fd
commit
900e3d0d3e
5 changed files with 581 additions and 10 deletions
|
|
@ -20,9 +20,9 @@ def get_or_create_session_for_wecom(
|
|||
external_chat_id: str,
|
||||
is_group: bool,
|
||||
) -> SessionMapResult:
|
||||
"""Group: session per chat_id; DM: session per user_id.
|
||||
"""Group chats share one session per external_chat_id (sentinel user key).
|
||||
|
||||
We store mapping under (tenant, channel, external_chat_id, external_user_id) to keep it simple.
|
||||
Direct chats use one session per external_user_id. Identity binding always uses the real sender id.
|
||||
"""
|
||||
scope = "group" if bool(is_group) else "dm"
|
||||
# For DM, external_chat_id is often contact id; we still keep it as provided.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue