Fix flat replies in DMs

DM replies were threaded under Adam's message instead of appearing flat.
Root cause: listener fell back to event["ts"] as thread_ts for new DMs,
causing say() to post as a threaded reply. Removed the fallback so DMs
always use flat messages with placeholder update.

Closes #4
This commit is contained in:
Adam Moussa 2026-05-04 20:04:31 -04:00
parent 5646080981
commit 36bd41e238

View file

@ -64,7 +64,7 @@ def _get_coordination(channel, thread_ts):
def _dispatch_conversation(text, thread_ts, channel, say, is_dm):
placeholder_ts = None
if is_dm:
result = say(text="Thinking...", thread_ts=thread_ts)
result = say(text="Thinking...")
placeholder_ts = result["ts"]
lambda_client.invoke(
@ -143,7 +143,7 @@ def handle_message(event, say):
if not text:
return
thread_ts = event.get("thread_ts") or event["ts"]
thread_ts = None
_dispatch_conversation(text, thread_ts, event["channel"], say, is_dm=True)