Skip to content

[Bug]: MSTeams Channel Replies Not Being Sent #9873

@matosonline

Description

@matosonline

Bug Report: MSTeams Channel Replies Not Being Sent

Reporter: [REDACTED]
Date: 2026-02-05
OpenClaw Version: 2026.2.1
Platform: WSL2 (Linux 6.6.87.2-microsoft-standard-WSL2, x64)
Node Version: v22.22.0
Affected Plugin: /mnt/e/openclaw/extensions/msteams/


Summary

Agent successfully processes Microsoft Teams channel messages and generates replies, but replies are never sent back to Teams channels. DM replies work correctly. This is a critical bug affecting all Teams channel interactions.


Environment

  • OpenClaw: 2026.2.1
  • Runtime: WSL2 on Windows
  • Agent: [Bot Name] (main agent)
  • Model: anthropic/claude-sonnet-4-5 (primary), openai-codex/gpt-5.2 (fallback)
  • Teams App ID: [REDACTED-APP-ID]
  • Tenant ID: [REDACTED-TENANT-ID]

Problem Description

Primary Issue (Critical)

When a user @mentions the bot in a Teams channel, the message is received and processed, the agent generates a reply, but the reply is never sent back to Teams. No errors are logged.

Secondary Issue

Messages without @mentions are routed to the DM session instead of the channel session, despite groupPolicy: "open" and requireMention: false being set.


Steps to Reproduce

Setup

  1. Install bot to a Teams team
  2. Configure gateway with:
{
  "channels": {
    "defaults": {
      "groupPolicy": "open"
    },
    "msteams": {
      "enabled": true,
      "groupPolicy": "open",
      "teams": {
        "[REDACTED-TEAM-ID]": {
          "replyStyle": "top-level"
        }
      }
    }
  }
}

Reproduce Bug

  1. In Teams channel, post: @[botname] test message
  2. Wait for processing to complete
  3. Expected: Bot replies in the channel
  4. Actual: No reply appears in Teams

Diagnostic Evidence

Log Evidence (from /tmp/openclaw/openclaw-2026-02-05.log)

Message Received Successfully

2026-02-05T19:11:55.260Z [msteams] received message
2026-02-05T19:11:56.451Z [msteams] dispatching to agent
2026-02-05T19:11:57.815Z [diagnostic] lane enqueue: lane=session:agent:main:msteams:channel:[REDACTED-CONVERSATION-ID]@thread.tacv2

Agent Processing Completed

2026-02-05T19:11:57.843Z [agent/embedded] embedded run start: runId=af20ba96-03d1-4de2-9e98-9636444e5434 sessionId=f490c738-8c0e-426b-a7b6-5941fdf15921 messageChannel=msteams
2026-02-05T19:12:04.653Z [agent/embedded] embedded run agent end
2026-02-05T19:12:04.680Z [agent/embedded] embedded run done: durationMs=6839 aborted=false
2026-02-05T19:12:06.362Z [msteams] dispatch complete

NO Send Activity

  • Expected: Log entries like msteams:send or sending proactive message
  • Actual: None found in logs around timestamp 19:12:04-19:12:07

Comparison: Working DM Send (for reference)

2026-02-05T17:13:28.603Z [msteams:send] sending proactive message
2026-02-05T17:13:29.970Z [msteams:send] sent proactive message

Session History Evidence

Query: sessions_history(sessionKey="agent:main:msteams:channel:[REDACTED-CONVERSATION-ID]@thread.tacv2")

User message:

[2026-02-05 14:11:55 EST] test message

Agent reply (generated but never sent):

Great! This message came through **without** a mention — so the mention gate fix is working now! 

Did you also fix the image issue? Want to test sending me an image to see if I can now see it?

Delivery context in session:

{
  "deliveryContext": {
    "channel": "msteams",
    "to": "conversation:[REDACTED-CONVERSATION-ID]@thread.tacv2",
    "accountId": "default"
  }
}

Expected vs Actual Behavior

Context Expected Actual Status
DM to bot Message received → Reply sent ✅ Works correctly ✅ PASS
Channel @mention Message received → Reply sent ❌ Reply generated but not sent FAIL
Channel no mention Message received by channel session ❌ Routes to DM session instead ❌ FAIL

Additional Context

What We Tried (All Failed)

  1. ✅ Verified bot has correct manifest scopes: ["personal", "team", "groupChat"]
  2. ✅ Added Microsoft Graph permission Group.Read.All with admin consent
  3. ✅ Set groupPolicy: "open" in both channels.defaults and channels.msteams
  4. ✅ Added team by ID and by name to allowlist
  5. ✅ Set requireMention: false at team level
  6. ✅ Removed tool restrictions that might interfere
  7. ✅ Set replyStyle: "top-level" for the team
  8. ✅ Multiple gateway restarts
  9. ✅ Verified Graph API team resolution working

None of these resolved the channel reply issue.

Key Observations

  1. DMs work perfectly - send logs appear, replies are delivered
  2. Channel processing works - messages are received, agent runs successfully
  3. Reply generation works - session history shows valid replies created
  4. Reply delivery fails silently - no send attempt logged, no errors, no timeout

This suggests the bug is in the conversation reference handling or proactive messaging logic specifically for channel conversations in /mnt/e/openclaw/extensions/msteams/.

Relevant Files

  • Plugin: /mnt/e/openclaw/extensions/msteams/
  • Source file (suspected): /mnt/e/openclaw/extensions/msteams/src/monitor-handler/message-handler.ts
  • Logs: /tmp/openclaw/openclaw-2026-02-05.log

Teams Channel Details

  • Team Name: [My Team]
  • Team ID: [REDACTED-TEAM-ID]
  • Channel Name: General
  • Conversation ID: [REDACTED-CONVERSATION-ID]@thread.tacv2
  • Channel Type: Appears to be "Threads" style (not classic "Posts")
  • Session Key: agent:main:msteams:channel:[REDACTED-CONVERSATION-ID]@thread.tacv2

Suspected Root Cause

The MSTeams plugin likely:

  1. ✅ Correctly stores conversation reference when receiving channel messages
  2. ✅ Correctly routes to channel-specific session
  3. Fails to use stored conversation reference when sending replies back

Possible issues:

  • Conversation reference not being passed to send logic
  • Reply delivery code path missing for channel conversations
  • Bug in proactive messaging for threaded conversations (@thread.tacv2)
  • Silent error swallowing in send path

Workaround

Current: Bot works correctly for DMs only. Channel interactions are non-functional.


Impact

Severity: HIGH
Impact: Complete inability to use bot in Teams channels (only DMs work)

This blocks:

  • Team collaboration use cases
  • Multi-user channel assistance
  • Public/shared bot interactions in Teams

Attachments

  • Full config: Available upon request (contains sensitive credentials)
  • Session transcript: Available via sessions_history for sessionId f490c738-8c0e-426b-a7b6-5941fdf15921
  • Logs: /tmp/openclaw/openclaw-2026-02-05.log (entries 2904-2924 for failing message)

Contact

Reporter: [REDACTED]
Available for testing/follow-up


Generated: 2026-02-05 14:57 EST
Session ID: 06f7f265-ebfb-4a1b-a616-3aa007ef42a6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions