Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
The proactive send path in extensions/msteams/src/send.ts hardcodes replyStyle: "top-level" when calling sendMSTeamsMessages(), causing all proactive/CLI-sent messages to land as new top-level channel posts regardless of whether the conversation has thread context available.
Steps to reproduce
- Configure msteams plugin with a channel where the bot has been @mentioned in a thread (so a stored conversation reference with
threadIdexists). - Send a proactive message to that conversation via the message tool or
openclaw send. - Observe the message lands as a new top-level post instead of in the thread.
Expected behavior
When sending a proactive message to a channel conversation that has a known thread root (threadId or activityId on the stored conversation reference), the message should be delivered into the correct channel thread.
Actual behavior
All proactive messages (from the message tool, CLI, or any code path through sendTextWithMedia()) create new top-level posts in the channel, breaking conversational threading. The replyStyle: "top-level" hardcode at extensions/msteams/src/send.ts:399 bypasses any thread context.
OpenClaw version
2026.5.5
Operating system
Linux (reproduced on Ubuntu 24.04)
Install method
pnpm dev
Model
N/A (channel routing issue, model-independent)
Provider / routing chain
N/A (issue is in the msteams channel plugin send path, not provider routing)
Additional provider/model setup details
N/A
Logs, screenshots, and evidence
Root cause in code:
extensions/msteams/src/send.tsline 399 —replyStyle: "top-level"hardcoded insendTextWithMedia()extensions/msteams/src/messenger.tsline 575 —throw new Error("Missing context for replyStyle=thread")blocks the proactive path from threading even if the hardcode were removed
Impact and severity
- Affected: All MS Teams channel users receiving proactive messages (message tool, CLI sends)
- Severity: High (breaks thread reply routing for all proactive sends to channels)
- Frequency: Always (100% of proactive channel sends)
- Consequence: Conversations fragment into disconnected top-level posts instead of threading, confusing users and breaking context
Additional information
The inbound reply-dispatcher path (reply-dispatcher.ts) handles threading correctly when a live turn context is available. The bug is specifically in the proactive/outbound send path which never has a turn context.
Fix submitted in #78299.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon May 6, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.
Summary
Keep open: current main still contains the Microsoft Teams proactive-send threading bug, and #78299 is an open closing PR rather than a merged fix.
Reproducibility: yes. from source inspection: the proactive send path resolves a stored conversation reference and then forces
replyStyle: "top-level"; choosingthreadtoday would hit the no-context throw insendMSTeamsMessages(). I did not run a live Teams send in this read-only review.Next step
No separate repair job should be queued because #78299 is already an open closing PR for the same narrow fix.
Review details
Best possible solution:
Review and land #78299 or an equivalent focused fix that derives proactive channel reply style from stored thread roots, allows no-context threaded proactive sends, and adds regression coverage.
Do we have a high-confidence way to reproduce the issue?
Yes, from source inspection: the proactive send path resolves a stored conversation reference and then forces
replyStyle: "top-level"; choosingthreadtoday would hit the no-context throw insendMSTeamsMessages(). I did not run a live Teams send in this read-only review.Is this the best way to solve the issue?
Yes, the narrow maintainable fix is to reuse the stored
threadId/activityIdfor proactive channel sends and route no-context threaded sends through the existing proactive thread-targeting helper. #78299 is the right review lane, but this issue should remain open until that PR merges or is replaced.What I checked:
sendTextWithMedia()callssendMSTeamsMessages()withreplyStyle: "top-level", so the proactive/CLI send path ignores any stored channel thread root. (extensions/msteams/src/send.ts:398, 98cbf7f11c35)sendMSTeamsMessages()resolvesthreadId ?? activityId, but thereplyStyle === "thread"branch throws when there is no live turn context, which is exactly the proactive send case. (extensions/msteams/src/messenger.ts:570, 98cbf7f11c35)threadIdfrom the Teams;messageid=suffix orreplyToId, and the stored reference type exposesthreadId, so the proactive path has data it currently does not use. (extensions/msteams/src/monitor-handler/message-handler.ts:246, 98cbf7f11c35)replyStyleand explicitly warn thattop-levelin classic Posts-style channels creates separate top-level posts instead of in-thread replies. Public docs:docs/channels/msteams.md. (docs/channels/msteams.md:724, 98cbf7f11c35)threadIdexists, matching the observed failure whensend.tsalways chooses top-level. (extensions/msteams/src/messenger.test.ts:577, 98cbf7f11c35)send.ts/messenger.tssurfaces for the reported behavior. (4669f05e2e8b)Likely related people:
extensions/msteams/src/messenger.ts,extensions/msteams/src/monitor-handler/message-handler.ts,extensions/msteams/src/send.ts)extensions/msteams/src/send.ts,extensions/msteams/src/messenger.ts,extensions/msteams/src/monitor-handler/message-handler.ts)extensions/msteams/src/messenger.ts,extensions/msteams/src/messenger.test.ts)Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 98cbf7f11c35.
fix(msteams): respect thread context in proactive send path
[-]msteams: proactive send path hardcodes replyStyle top-level, ignoring thread config[/-][+][Bug]: msteams proactive send path hardcodes replyStyle top-level, ignoring thread config[/+]