msteams: fix image download auth, double-counting, and typing indicator#26274
msteams: fix image download auth, double-counting, and typing indicator#26274nicksav wants to merge 8 commits intoopenclaw:mainfrom
Conversation
…ize channel lifecycle
|
This pull request has been automatically marked as stale due to inactivity. |
|
Hi @nicksav — thanks for the submission. I’m the new Microsoft Teams maintainer for OpenClaw. Please give me a day or two to work through the open Teams backlog. Also, join the Twitter community for daily MS Teams feedback + updates: https://x.com/i/communities/2031170403607974228 |
1 similar comment
|
Hi @nicksav — thanks for the submission. I’m the new Microsoft Teams maintainer for OpenClaw. Please give me a day or two to work through the open Teams backlog. Also, join the Twitter community for daily MS Teams feedback + updates: https://x.com/i/communities/2031170403607974228 |
|
Closing this stale Microsoft-tracker item for cleanup. If this is still an issue or still worth pursuing, please re-open it. We now have dedicated Microsoft maintainers watching this area. |
Summary
smba.trafficmanager.netrequires a Bearer token, but the msteams extension never attempts auth for that host. Additionally, image count is incorrectly reported as "2 images" for a single image, and there is no typing indicator while images are being downloaded.trafficmanager.net(Bot Framework attachment service) and Skype CDN hosts (asm.skype.com,ams.skype.com,media.ams.skype.com) toDEFAULT_MEDIA_AUTH_HOST_ALLOWLISTfetchWithAuthFallbackto send auth token upfront for known-protected hosts instead of making a wasted unauthenticated request that always returns 401/403<img>tags are detectedbuildMSTeamsAttachmentPlaceholderto avoid double-counting when both animage/*attachment and an HTML<img>tag reference the same imageadapter.continueConversationfor proactive messaging to avoid revoked TurnContext proxy errorsChange Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
<media:image>placeholder only and agent could not see image content)Security Impact (required)
NoNo— uses the existing Bot Framework token provider, just for additional known-Microsoft hostsYes— authenticated requests are now sent tosmba.trafficmanager.netand Skype CDN hosts using the existing BF token. Previously these requests were unauthenticated and failed with 401/403.NoNoDEFAULT_MEDIA_AUTH_HOST_ALLOWLIST. All added hosts are official Microsoft/Bot Framework domains. The Bot Framework token was already available and used for messaging.Repro + Verification
Environment
Steps
Expected
Actual (before fix)
<media:image>placeholder text and says it cannot see the imageEvidence
Before fix - logs show:
After fix - image downloads successfully and bot describes image content.
All 20 msteams attachment tests pass (
pnpm vitest run extensions/msteams/src/attachments.test.ts).New test added for double-counting regression:
does not double-count when image attachment and HTML img tag refer to the same image.Human Verification (required)
Cannot perform 'get' on a proxy that has been revokederrors from typing indicatorCompatibility / Migration
YesNoNoFailure Recovery (if this breaks)
DEFAULT_MEDIA_AUTH_HOST_ALLOWLISTentries)Risks and Mitigations
trafficmanager.net,asm.skype.com,ams.skype.com,media.ams.skype.com)Made with Cursor
Greptile Summary
This PR fixes three critical issues in the msteams extension: image downloads from Bot Framework attachment service (
smba.trafficmanager.net) that were failing with 401 errors, incorrect "2 images" count for single images, and missing typing indicators during image downloads.Key changes:
trafficmanager.netand Skype CDN hosts (asm.skype.com,ams.skype.com,media.ams.skype.com) to the auth allowlistfetchWithAuthFallbackto send auth tokens upfront for known-protected hosts instead of wasting a request that always returns 401buildMSTeamsAttachmentPlaceholderto avoid counting the same image twice when both explicit attachment and HTML<img>tag existcontinueConversationpattern to avoid TurnContext proxy revocation errorsAll changes are backward compatible. Tests have been updated and a new test case added for the double-counting regression.
Confidence Score: 5/5
Last reviewed commit: 24c3b54
(2/5) Greptile learns from your feedback when you react with thumbs up/down!