fix(msteams): route file attachment sends through thread-aware delivery path#89094
fix(msteams): route file attachment sends through thread-aware delivery path#89094whiteyzy wants to merge 2 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 11, 2026, 9:20 AM ET / 13:20 UTC. Summary PR surface: Source +11, Tests +98. Total +109 across 2 files. Reproducibility: no. live high-confidence reproduction was run in this read-only review. Source inspection shows current main sends SharePoint and OneDrive file activities through Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one focused Teams file-threading fix after accessible redacted Teams proof shows the file reply lands in the intended channel thread. Do we have a high-confidence way to reproduce the issue? No live high-confidence reproduction was run in this read-only review. Source inspection shows current main sends SharePoint and OneDrive file activities through Is this the best way to solve the issue? Yes, this is the right owner boundary because it keeps the fix inside the Microsoft Teams plugin send path and reuses the existing SDK proactive thread option rather than adding a new core or config surface. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 79d7defd0ba4. Label changesLabel justifications:
Evidence reviewedPR surface: Source +11, Tests +98. Total +109 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Here is a video showing proof that this fix correctly directs outbound attachments to the proper thread: |
…ry path SharePoint file card and OneDrive file-link sends bypassed the thread-aware sendMSTeamsMessages path, calling sendProactiveActivityRaw directly without threadActivityId. When replyStyle is "thread" in a channel conversation, attachment replies appeared as top-level messages instead of in-thread replies. Add threadActivityId resolution to the file send branches and pass it through sendProactiveActivityRaw to sendMSTeamsActivityWithReference. This reuses the same thread-root resolution as the text/inline-media path (ref.threadId ?? ref.activityId). Closes openclaw#88836
…rive mocks
- Replace adapter:{} with app:createMockApp() in both new tests so
sendMSTeamsActivityWithReference receives a real app parameter
- Add uploadAndShareOneDrive to mockState for proper mock control
- Mock OneDrive upload result so the production path reaches the
threaded send call
- Add uploadAndShareOneDrive to beforeEach reset
Refs: openclaw#88836
cabcc67 to
67f04bc
Compare
|
@clawsweeper re-review Updated (per P2 review feedback):
Real behavior proof: Community member @cmc099 provided video proof showing the fix correctly directs outbound attachments to the proper thread: |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Updated proof (replaces inaccessible SharePoint video): The community SharePoint video returned 403 FORBIDDEN and is not reviewer-accessible. Replaced with terminal test output that exercises the actual The fix follows the exact same
|
|
Closing: unable to provide accessible real Microsoft Teams proof. ClawSweeper requires redacted Teams screenshots/recording showing file attachment replies land in the intended channel thread. The community SharePoint video is inaccessible (403 Forbidden) and the contributor does not have a Teams tenant to generate new proof. The code fix is rated 🐚 platinum hermit (patch quality) and follows the exact same threadActivityId resolution pattern used by sendMSTeamsMessages. A maintainer with Teams access can verify and land. Closes #88836. |
|
Here's a YouTube link of the same video showing the fix working in Teams. Should resolve the 403 SharePoint issue. https://youtu.be/k3FlxdcU9zg @whiteyzy Could we reopen this PR for review? |
|
Kindly requesting to reopen this PR for review given the updated proof video. |
Summary
Fix Microsoft Teams file attachment sends to route through the thread-aware delivery path when
replyStyle: "thread"is configured for channel conversations.SharePoint file card sends and OneDrive file-link fallback sends bypassed the thread-aware
sendMSTeamsMessagespath, callingsendProactiveActivityRawdirectly withoutthreadActivityId. WhenreplyStyleresolves to"thread"in a channel, attachment replies appeared as top-level messages instead of in-thread replies.Root Cause
sendProactiveActivityRawinextensions/msteams/src/send.tsdid not accept or forward athreadActivityIdparameter. Two file send branches (SharePoint native file card at line 305, OneDrive file-link fallback at line 349) used this function directly, so attachment sends always lacked thread routing information regardless of the configuredreplyStyle.The text/inline-media path (
sendTextWithMedia→sendMSTeamsMessages) correctly resolves and forwards the thread root (ref.threadId ?? ref.activityId), but the file attachment branches had no equivalent.Fix
replyStyleto the destructured context insendMessageMSTeamsthreadActivityIdonce fromref.threadId ?? ref.activityIdwhen the conversation is a channel andreplyStyleis"thread"threadActivityIdas an optional parameter tosendProactiveActivityRawand forward it tosendMSTeamsActivityWithReferencethreadActivityIdat both the SharePoint file card and OneDrive file-link call sitesUnit tests
Added 2 tests in
send.test.ts:threadActivityIdwhenreplyStyle: "thread"in a channelthreadActivityIdwhenreplyStyle: "thread"in a channelReal behavior proof
Behavior or issue addressed: Microsoft Teams channel replies with file attachments appear as top-level messages instead of in-thread when
replyStyle: "thread"is configured.Real environment tested: macOS 15.4 (darwin arm64), Node.js v22.22.3. Unit tests verify the exact code paths identified in the ClawSweeper source-level reproduction.
Exact steps or command run after this patch: Unit tests exercise both the SharePoint file card and OneDrive fallback branches with
replyStyle: "thread"andconversationType: "channel", asserting thatsendMSTeamsActivityWithReferencereceives the correctthreadActivityIdoption.Evidence after fix:
Observed result after fix:
sendMSTeamsActivityWithReferenceis called withthreadActivityIdmatchingref.threadIdfor both SharePoint and OneDrive attachment sends whenreplyStyle === "thread"and the conversation is a channel. ThethreadActivityIdparameter is omitted (undefined) for non-channel conversations and whenreplyStyleis"top-level", preserving existing behavior.What was not tested: Live Microsoft Teams tenant end-to-end test with actual thread routing verification. The code change follows the exact same thread-root resolution pattern already used by the text/inline-media send path.
Related
Closes #88836
🤖 Generated with Claude Code