When a Slack app has the Agent/Assistant toggle on, users get a 'Chat' tab
in the app sidebar (a dedicated assistant_thread). Messages typed there
arrive as message.im events with ThreadTimeStamp set to the assistant
thread's root ts.
Before this patch, cc-connect's Reply() and Send() ignore that thread_ts
(MsgOptionTS is a no-op on chat.postMessage; Send didn't pass it at all).
Replies thus went to the DM root, surfacing in the 'History' tab feed
rather than the Chat tab — breaking the conversational UX for any bot
configured as an Agent/Assistant.
Changes:
- New helper assistantOrThreadTS() returns ev.ThreadTimeStamp if present
- MessageEvent handler uses assistantOrThreadTS() for replyContext
- Reply() switched from MsgOptionTS (chat.update only) to
MsgOptionPostMessageParameters{ThreadTimestamp} (real thread reply)
- Send() now also includes ThreadTimestamp when present (engine often
falls back to Send when streaming preview is unavailable)
- New AssistantThreadStartedEvent handler logs the event + sets initial
status (informational; Reply path does the actual routing)
Tested against a live Donna Slack app with Agent enabled — replies now
land in Chat tab as expected.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>