Skip to content

fix(msteams): alias team config under channel conversation IDs for Agents SDK (#9873)#13089

Closed
BradGroux wants to merge 2 commits intoopenclaw:mainfrom
BradGroux:fix/msteams-9873-allowlist-null-names
Closed

fix(msteams): alias team config under channel conversation IDs for Agents SDK (#9873)#13089
BradGroux wants to merge 2 commits intoopenclaw:mainfrom
BradGroux:fix/msteams-9873-allowlist-null-names

Conversation

@BradGroux
Copy link
Copy Markdown
Contributor

@BradGroux BradGroux commented Feb 10, 2026

Problem

The Microsoft Agents SDK (which replaced Bot Framework) no longer populates activity.channelData.team.name or activity.channelData.channel.name. Only .id fields are provided:

{
  "teamId": "19:[email protected]",
  "teamName": null,
  "channelName": null,
  "teamObj": {"id": "19:[email protected]"},
  "channelObj": {"id": "19:[email protected]"}
}

At startup, the channel resolution maps user-friendly config keys (e.g. "Automation") to Graph API group IDs (e.g. fa101332-cf00-431b-...). But the Agents SDK sends the channel conversation thread ID (e.g. 19:[email protected]) as activity.channelData.team.id.

This ID mismatch causes the allowlist matcher to never find a team match, silently dropping all channel messages when groupPolicy: "allowlist" is set. DMs are unaffected.

Root Cause

  1. Monitor startup resolves "Automation" → Graph group ID fa101332-... and re-keys teams: config
  2. Incoming message has teamId = "19:[email protected]" (conversation thread ID)
  3. buildChannelKeyCandidates(teamId, teamName) produces only the thread ID (teamName is null)
  4. resolveChannelEntryMatchWithFallback tries to match thread ID against Graph group ID keys → no match
  5. channelGate.allowed = false → message dropped

Fix

After resolving each channel during startup, also register the team config under the channel's conversation ID. This ensures the allowlist matcher can find the team config regardless of which ID format the SDK provides.

Change: extensions/msteams/src/monitor.ts — 9 lines added in the resolution loop
Test: extensions/msteams/src/policy.test.ts — New test case for null teamName/channelName with ID-based matching

Debugging Evidence

Captured from a live 2026.2.9 deployment:

msteams channels resolved: Automation/General→fa101332-cf00-.../19:[email protected]

Activity data (teamName/channelName both null):

{"teamId":"19:[email protected]","teamName":null,"channelName":null}

Log confirming the drop:

dropping group message (not in team/channel allowlist)

Workaround (for users on current release)

Set groupPolicy: "open" in msteams config. The teams: block with requireMention: true still gates when the bot responds.

Closes #9873

Greptile Overview

Greptile Summary

This PR updates the Microsoft Teams extension’s startup allowlist resolution to handle an ID mismatch introduced by the Microsoft Agents SDK. During channel resolution in extensions/msteams/src/monitor.ts, the resolved team config (keyed by the Graph group ID) is also aliased under the channel conversation thread ID when they differ, so inbound events that provide only activity.channelData.team.id as a thread ID can still match allowlisted teams/channels.

It also adds a regression test in extensions/msteams/src/policy.test.ts covering the Agents SDK case where teamName/channelName are absent and matching must succeed based on ID keys alone.

Confidence Score: 4/5

  • This PR is likely safe to merge and narrowly addresses the reported ID mismatch in allowlist matching.
  • Changes are small and localized to config resolution/aliasing, and the added test exercises the Agents SDK null-name scenario. I could not run tests in this environment (no node/pnpm available), so the score is slightly reduced due to lack of execution verification.
  • extensions/msteams/src/monitor.ts

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

…ents SDK (openclaw#9873)

The Microsoft Agents SDK (replacing Bot Framework) no longer populates
activity.channelData.team.name or activity.channelData.channel.name —
only .id fields are provided. The channel resolution at startup maps
user-friendly config keys (e.g. 'Automation') to Graph API group IDs
(e.g. 'fa101332-...'), but the Agents SDK sends the channel conversation
thread ID (e.g. '19:[email protected]') as activity.channelData.team.id.

This mismatch causes the allowlist matcher to never find a team match,
silently dropping all channel messages when groupPolicy is 'allowlist'.

Fix: After resolving each channel, also register the team config under
the channel's conversation ID so the allowlist matcher can find it
regardless of which ID format the SDK provides.

Closes openclaw#9873
@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added the stale Marked as stale due to inactivity label Feb 21, 2026
@BradGroux
Copy link
Copy Markdown
Contributor Author

Still relevant.

@openclaw-barnacle openclaw-barnacle bot removed the stale Marked as stale due to inactivity label Feb 22, 2026
@BradGroux
Copy link
Copy Markdown
Contributor Author

Maintainer update (for review triage):

  • I verified PR branch freshness against current base.
  • Checked out PR head and rebased against the fork’s latest main.
  • Head commit is unchanged: 8f2595254bd68f1b7912ab04328a2f5b8f5e6c4b.
  • Rebase result: clean (no conflicts, no code delta required).

Actionable takeaway for maintainers: branch is current and ready for code review as-is.

@BradGroux
Copy link
Copy Markdown
Contributor Author

Pushed a branch refresh commit to ensure stale automation sees recent activity.\n\nLatest head: \n\nNo functional code changes; this is a metadata refresh to keep review active while maintainers triage.

@BradGroux
Copy link
Copy Markdown
Contributor Author

Maintainer update: I pushed a branch refresh commit so stale automation sees recent activity while this is triaged.

  • Latest head: 8d7fab3dd
  • Functional delta: none (activity refresh only)

PR should no longer be considered inactive.

@BradGroux
Copy link
Copy Markdown
Contributor Author

This was resolved with the latest Teams updates merged by @steipete, and can be closed.

@BradGroux BradGroux closed this Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: msteams Channel integration: msteams size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: MSTeams Channel Replies Not Being Sent

1 participant