Repository navigation
fix(msteams): keep structured sends in channel threads - #117516
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 1:01 PM ET / 17:01 UTC. ClawSweeper reviewWhat this changesThe PR resolves each Microsoft Teams proactive structured-send destination once, then uses that destination for adaptive cards, polls, consent cards, and native file cards so channel replies remain in their requested thread. Merge readinessKeep this PR open for explicit maintainer handling: the source-backed patch fixes the reported Microsoft Teams thread-routing gap through the proper proactive-send owner boundary, and no blocking correctness or security defect was found. The branch is cleanly mergeable but behind current Priority: P2 Review scores
Verification
How this fits togetherThe Microsoft Teams plugin turns an outbound target plus stored conversation reference into a proactive Bot Framework activity. That activity is sent through the Teams SDK to a conversation endpoint, where a channel-thread root must be encoded in the conversation identity while top-level channels, group chats, and personal chats retain the base identity. flowchart LR
A[Outbound message or poll] --> B[Target normalizer]
B --> C[Proactive send context]
C --> D{Channel thread?}
D -->|Yes| E[Thread-qualified conversation]
D -->|No| F[Base conversation]
E --> G[Teams SDK activity request]
F --> G
G --> H[Microsoft Teams delivery]
Decision needed
Why: The Before merge
Agent review detailsSecurityNone. PR surfaceSource -27, Tests +151. Total +124 across 6 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one closed proactive destination in the Microsoft Teams send context, retain the base destination for non-thread channel and chat routes, and merge after the exact-head checks confirm the same focused boundary coverage. Do we have a high-confidence way to reproduce the issue? Yes, at source level: a stored channel reference with a thread root reaches direct adaptive-card or poll creation without a thread-qualified conversation identity on current Is this the best way to solve the issue? Yes. Carrying the resolved destination through the proactive send context is the narrowest maintainable fix because the policy and thread root remain coupled for every direct activity kind, instead of adding sender-specific URL reconstruction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 581688143a97. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready review is complete for exact head The broken invariant was split destination ownership: the Teams send context exposed reply policy separately from the stored reference, so text/media and one recent attachment repair carried the thread root while polls and presentation/Adaptive Cards sent direct activities to the base conversation. The fix makes the destination a closed context variant—top-level, or channel thread plus exact activity root—and every direct activity sender consumes it. The poll adapter now preserves the standard outbound Proof:
The final current-main Testbox allocation stayed queued without a runner for five minutes and was stopped; direct AWS fallback lacked managed broker login. No touched file changed on main during the clean rebase, and the patch-identical Testbox proof is under 24 hours old. Exact-head hosted CI supplies the final current-head integration proof. ClawSweeper workflow https://github.com/openclaw/clawsweeper/actions/runs/30709286195 completed successfully for this head but left only its start placeholder, so it published no findings or rank-up moves and no bot approval is claimed. |
|
Merged via squash.
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(msteams): keep structured sends in channel threads This is item 3/3 in the current shard. Shard 6/45. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
Closes #117514
What Problem This Solves
Fixes an issue where Microsoft Teams users receiving polls, presentation cards, or Adaptive Cards as channel-thread replies would see those messages posted at channel top level instead of inside the requested thread.
Why This Change Was Made
The proactive send context now owns one closed destination: either a top-level conversation or a channel thread with its exact activity root. Every direct activity kind consumes that resolved context, so text, media, consent cards, native file cards, presentation cards, and polls share one thread-routing decision. The outbound poll adapter also preserves its standard
threadIdthrough the existing target normalizer.The pinned Microsoft Teams SDK 2.0.14 routes proactive creation by
ref.conversation.id;activityIdis not used for that path. The fix therefore carries the Connector;messageid=<root>identity in the resolved conversation reference instead of reconstructing it in individual senders.Top-level channel sends, group chats, and personal chats remain on the base conversation. There is no protocol, config, persistence, dependency, migration, or public SDK change.
User Impact
Teams polls and structured cards now remain attached to the channel conversation that requested them. Operators no longer get detached top-level posts for thread-scoped actions, while ordinary top-level channels, group chats, and DMs keep their existing routing.
Before
After
Evidence
tbx_01kyyzz83vdyzy947dgq4zkg0z, run https://github.com/openclaw/openclaw/actions/runs/30706587571.@microsoft/teams.apps/@microsoft/teams.api2.0.14 HTTP client and assert exact paths and activity payloads for threaded channels, top-level channels, group chats, and DMs.ActivitySender.sendpassesref.conversation.idto the conversation client, which interpolates it into/v3/conversations/{id}/activities.origin/mainatea2e7f46a69744a6d1b346db20043a3388f9b001; none of the six touched files had mainline drift.send-context.tsalready requiresconversationType === "channel"; group/personal routes return the closed top-level variant.git diff --checkis clean.+35/-62(net-27); tests:+174/-23.The final current-main Testbox request remained queued without allocation for five minutes and was stopped; direct AWS fallback was unavailable because this machine lacks managed broker login. The earlier patch-identical Testbox proof is under 24 hours old, and exact-head hosted CI is required before landing.
No live tenant credentials were used; the real SDK HTTP boundary deterministically proves the routing contract.
Release-note context: Microsoft Teams polls and structured cards now stay in their requested channel threads.
AI-assisted: yes. The implementation was independently reviewed, checked against the pinned SDK source, and remotely validated.