Problem
When an agent uses the message tool to send a proactive message (without an explicit replyTo), the message lands in the Mattermost channel root — even when the active session is thread-scoped (replyToMode: "all").
Reproduction:
- Configure Mattermost with
replyToMode: "all"
- Start a conversation in a channel thread
- Have the agent call
message(action="send", channel="mattermost", target="channel:<id>", message="...") without specifying replyTo
- Message appears at channel root, not in the thread
Expected behavior
When the active session has thread context (session key contains :thread:<postId>, delivery context has threadId set), a proactive message tool send should default to the current thread.
Root cause
The message tool constructs a delivery payload with an explicit to target but no threadId/replyTo. It bypasses the session delivery routing that carries thread context. Unlike the TUI chat.send path (fixed in #44283 via deliver: true), the tool send path does not inherit session.deliveryContext.threadId.
Relationship
This is the remaining open case from #39759 after #44283 is merged. Manually tested and confirmed on prod 2026-03-13.
Problem
When an agent uses the
messagetool to send a proactive message (without an explicitreplyTo), the message lands in the Mattermost channel root — even when the active session is thread-scoped (replyToMode: "all").Reproduction:
replyToMode: "all"message(action="send", channel="mattermost", target="channel:<id>", message="...")without specifyingreplyToExpected behavior
When the active session has thread context (session key contains
:thread:<postId>, delivery context hasthreadIdset), a proactivemessagetool send should default to the current thread.Root cause
The
messagetool constructs a delivery payload with an explicittotarget but nothreadId/replyTo. It bypasses the session delivery routing that carries thread context. Unlike the TUIchat.sendpath (fixed in #44283 viadeliver: true), the tool send path does not inheritsession.deliveryContext.threadId.Relationship
This is the remaining open case from #39759 after #44283 is merged. Manually tested and confirmed on prod 2026-03-13.