fix(msteams): alias team config under channel conversation IDs for Agents SDK (#9873)#13089
Closed
BradGroux wants to merge 2 commits intoopenclaw:mainfrom
Closed
fix(msteams): alias team config under channel conversation IDs for Agents SDK (#9873)#13089BradGroux wants to merge 2 commits intoopenclaw:mainfrom
BradGroux wants to merge 2 commits intoopenclaw:mainfrom
Conversation
…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
bfc1ccb to
f92900f
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
Contributor
Author
|
Still relevant. |
Contributor
Author
|
Maintainer update (for review triage):
Actionable takeaway for maintainers: branch is current and ready for code review as-is. |
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. |
Contributor
Author
|
Maintainer update: I pushed a branch refresh commit so stale automation sees recent activity while this is triaged.
PR should no longer be considered inactive. |
Contributor
Author
|
This was resolved with the latest Teams updates merged by @steipete, and can be closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Microsoft Agents SDK (which replaced Bot Framework) no longer populates
activity.channelData.team.nameoractivity.channelData.channel.name. Only.idfields 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]) asactivity.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
"Automation"→ Graph group IDfa101332-...and re-keysteams:configteamId = "19:[email protected]"(conversation thread ID)buildChannelKeyCandidates(teamId, teamName)produces only the thread ID (teamName is null)resolveChannelEntryMatchWithFallbacktries to match thread ID against Graph group ID keys → no matchchannelGate.allowed = false→ message droppedFix
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 loopTest:
extensions/msteams/src/policy.test.ts— New test case for null teamName/channelName with ID-based matchingDebugging Evidence
Captured from a live 2026.2.9 deployment:
Activity data (teamName/channelName both null):
{"teamId":"19:[email protected]","teamName":null,"channelName":null}Log confirming the drop:
Workaround (for users on current release)
Set
groupPolicy: "open"in msteams config. Theteams:block withrequireMention: truestill 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 onlyactivity.channelData.team.idas a thread ID can still match allowlisted teams/channels.It also adds a regression test in
extensions/msteams/src/policy.test.tscovering the Agents SDK case whereteamName/channelNameare absent and matching must succeed based on ID keys alone.Confidence Score: 4/5
(2/5) Greptile learns from your feedback when you react with thumbs up/down!