feat(whatsapp): real group @mentions and cleaner inbound text

Wire mention JIDs/names through scheduled delivery and immediate replies (including attachment captions), sanitize group message text for the model, and surface channel-derived sessions in admin Chat.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-07-13 20:05:43 +08:00
parent cbe68a54cd
commit ad5d1db3c6
19 changed files with 1507 additions and 58 deletions

View file

@ -189,8 +189,18 @@ def resolve_scheduled_session(
external_user_id=external_user_id,
session_title=f"Scheduled · {job_name}",
)
if user_id:
store.ensure_ui_session_owner(session_id=session_id, tenant_id=tenant_id, user_id=user_id)
from runtime.application.gateway.channel_session_owner import (
assign_channel_session_to_account_owner,
)
assign_channel_session_to_account_owner(
store,
session_id=session_id,
channel="whatsapp",
account_id=account_id,
tenant_id=tenant_id,
fallback_user_id=user_id,
)
return ResolvedSession(
session_id=session_id,
tenant_id=tenant_id,
@ -219,8 +229,18 @@ def resolve_scheduled_session(
external_user_id=external_user_id,
session_title=f"Scheduled · {job_name}",
)
if user_id:
store.ensure_ui_session_owner(session_id=session_id, tenant_id=tenant_id, user_id=user_id)
from runtime.application.gateway.channel_session_owner import (
assign_channel_session_to_account_owner,
)
assign_channel_session_to_account_owner(
store,
session_id=session_id,
channel=channel,
account_id=account_id,
tenant_id=tenant_id,
fallback_user_id=user_id,
)
return ResolvedSession(
session_id=session_id,
tenant_id=tenant_id,