From 138f9224c348c5c964bf8552990466238621b6b4 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 12 May 2026 14:17:02 -0500 Subject: [PATCH] fix: use sender from_id as actor_id in groups, not group chat_id --- src/lambdas/agent-runner/handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lambdas/agent-runner/handler.py b/src/lambdas/agent-runner/handler.py index b8d39f5..bd26ccc 100644 --- a/src/lambdas/agent-runner/handler.py +++ b/src/lambdas/agent-runner/handler.py @@ -142,7 +142,10 @@ def handler(event, context): channel = first.get('channel', 'telegram') chat_id = first.get('chat_id', '') message_thread_id = first.get('message_thread_id') # int or None - actor_id = f"{channel}:{chat_id}" + # Use sender's user ID for identity (not chat_id, which is the group ID in group chats) + from_info_early = first.get('messages', [{}])[0] + sender_id = from_info_early.get('from_id') or chat_id + actor_id = f"{channel}:{sender_id}" # ── User registry ───────────────────────────────────────────────────── from_info = first.get('messages', [{}])[0]