Skip to content

[Bug]: msteams proactive send path hardcodes replyStyle top-level, ignoring thread config #78298

Closed

Description

@feiskyer

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

  1. Configure msteams plugin with a channel where the bot has been @mentioned in a thread (so a stored conversation reference with threadId exists).
  2. Send a proactive message to that conversation via the message tool or openclaw send.
  3. 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:

  1. extensions/msteams/src/send.ts line 399 — replyStyle: "top-level" hardcoded in sendTextWithMedia()
  2. extensions/msteams/src/messenger.ts line 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.

Activity

  1. clawsweeper commented on May 6, 2026

    @clawsweeper
    Contributor

    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"; choosing thread today would hit the no-context throw in sendMSTeamsMessages(). 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"; choosing thread today would hit the no-context throw in sendMSTeamsMessages(). 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/activityId for 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:

    Likely related people:

    • sudie-codes: Recent merged Microsoft Teams work touched thread routing and proactive send behavior on the same messenger and monitor-handler surfaces. (role: threading and proactive-send maintainer; confidence: high; commits: 9edfefedf7bf, 2b5b58194b7e, 784318799bf0; files: extensions/msteams/src/messenger.ts, extensions/msteams/src/monitor-handler/message-handler.ts, extensions/msteams/src/send.ts)
    • steipete: History and shortlog show heavy recent maintenance across the affected Microsoft Teams send, messenger, and message lifecycle files. (role: recent maintainer; confidence: high; commits: 05eda57b3c72, 3f002b10d281, ffe67e9cdc9e; files: extensions/msteams/src/send.ts, extensions/msteams/src/messenger.ts, extensions/msteams/src/monitor-handler/message-handler.ts)
    • hyojin: Earlier Microsoft Teams work preserved channel reply threading in the proactive fallback path, which is the helper behavior this issue depends on. (role: adjacent threading owner; confidence: medium; commits: 739ed1bf2944; files: extensions/msteams/src/messenger.ts, extensions/msteams/src/messenger.test.ts)

    Remaining risk / open question:

    • No live Microsoft Teams tenant proactive send was run in this read-only review; the failure is source-proven rather than runtime-proven.

    Codex review notes: model gpt-5.5, reasoning high; reviewed against 98cbf7f11c35.

  2. added a commit that references this issue on May 6, 2026
    4669f05
  3. changed the title [-]msteams: proactive send path hardcodes replyStyle top-level, ignoring thread config[/-] [+][Bug]: msteams proactive send path hardcodes replyStyle top-level, ignoring thread config[/+] on May 6, 2026
  4. locked as resolved and limited conversation to collaborators on May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions