Repository navigation
fix(msteams): prevent duplicate final replies - #116398
vincentkoc merged 7 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 3:04 AM ET / 07:04 UTC. ClawSweeper reviewWhat this changesThis PR records authoritative Microsoft Teams conversation and thread identity for message-tool deliveries, then suppresses an automatic final reply only when it repeats a confirmed same-route delivery. Merge readinessKeep this PR open for maintainer review. The supplied exact-head Gateway proof is strong and current main visibly lacks the Teams thread-aware route evidence required for safe deduplication, but this read-only partial checkout could not materialize the PR’s changed blobs because its promisor remote could not resolve GitHub; that prevents a high-confidence exact-head source verdict. Priority: P1 Review scores
Verification
How this fits togetherThe Microsoft Teams plugin turns inbound Bot Framework activity into a current conversation and thread context, then records outbound message-tool delivery facts. The core embedded-agent subscriber uses those facts while streaming and delivering automatic replies so it can avoid a duplicate without hiding text meant for another conversation or thread. flowchart LR
A[Teams inbound activity] --> B[Conversation and thread context]
B --> C[Message tool send]
C --> D[Confirmed delivery route]
D --> E[Core preview and final decision]
E --> F[Suppress duplicate or send distinct reply]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +365, Tests +1022, Docs +1, Other +243. Total +1631 across 31 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: 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: Materialize the exact PR head in a healthy checkout, confirm the plugin’s normalized Teams route facts feed the existing channel-plugin seams without widening cross-route suppression, then merge if the supplied same-route and distinct-route Gateway scenario remains green. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main requires exact route and thread evidence for safe source-reply dedupe, while the current Teams tool context records only ReplyToId as its thread fact. The supplied exact-head Gateway scenario then exercises same-thread, direct-message, group-chat, other-thread, and other-conversation cases. Is this the best way to solve the issue? Unclear pending direct PR-tree inspection: the proposed plugin-owned Teams identity plus core-owned preview decision matches the existing plugin seam and avoids content-only global dedupe, but the local infrastructure failure prevents confirming every changed implementation detail at the exact head. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 78486e27511c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (13 earlier review cycles; latest 8 shown)
|
|
@clawsweeper please re-review |
Security-sensitive guard clearedThis PR no longer has blocked security-sensitive file changes. A future security-sensitive change requires a fresh
|
|
@clawsweeper re-review Exact-head causal integration proof is now in the PR body for |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Dependency graph guard clearedThis PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Exact-head runtime proof is now in the PR body for |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…98-main-4caff51-20260801 * origin/pr-116398: fix(agents): suppress duplicate source previews test(msteams): prove thread-aware final dedupe fix(msteams): preserve message-tool thread routing
…in-4caff51-20260801 * origin/main: fix(agents): surface /new guidance for thinking-signature replay errors (openclaw#116967) (openclaw#116987) fix(doctor): keep repaired session rows readable (openclaw#117207) fix(feishu): unify outbound delivery lifecycle (openclaw#117223) docs(gateway): document llamacpp toolSchemaProfile for custom llama.cpp endpoints (openclaw#117120) fix(clickclack): thread replies stop being answered past the 100-reply thread window (openclaw#117225) fix(talk): retain bounded relay close owners fix(talk): bound relay transcript persistence
…in-4caff51-20260801 * origin/main: fix(minimax): validate complete generated audio at producer owners (openclaw#117195) fix(line): centralize Flex alternative-text bounds (openclaw#117217)
|
@clawsweeper re-review Exact-head proof is now attached to the PR body for |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Final maintainer landing gate for exact head
Landing via squash with contributor authorship preserved. |
Closes #116397
What Problem This Solves
Fixes an issue where Microsoft Teams users could receive the same final answer twice when the agent used
message(action=send)and then returned identical text under automatic visible replies.Why This Change Was Made
Teams now records authoritative conversation and thread identity for message-tool sends, including direct messages, channel roots, explicit thread targets, and cross-conversation targets. Core also holds an automatic source preview while it can still be the same current-route message-tool delivery, then either suppresses the duplicate or releases a diverging response.
This keeps transport identity in the Teams plugin and source-preview ownership in the core agent subscriber. It does not weaken route isolation with content-only global dedupe.
The current-main repair also records confirmed current-source
replyandpolldeliveries outside send-only telemetry, so those sibling actions participate in the same preview-suppression contract.User Impact
Teams users get one visible answer when the message tool and automatic final represent the same delivery. Different threads, different conversations, explicit targets, and genuinely different automatic text remain visible.
Evidence Map
threading.buildToolContext; core partial-reply and message-tool result handlers.Evidence
457966c141b7591ec6ea78a60f30d10de9e985d6e679fba32d5a716141940d0baf21f5ac891e49baea46dbb83c66d399eba7c1438171389925958592extends the dedupe invariant to current-source reply and poll actions.tbx_01kyy0z92pjgyqnry2dysct2esfirst materialized treee679fba32d5a716141940d0baf21f5ac891e49ba, then passedOPENCLAW_BUILD_PRIVATE_QA=1 pnpm buildand the dedicatedmsteams-thread-message-tool-final-dedupeGateway scenario 1/1 with zero failures or skips: https://github.com/openclaw/openclaw/actions/runs/30688267540git diff --check, targetedoxfmt, and targetedoxlintpassed.The behavior run exercises real Gateway startup, the real Teams plugin, Bot Framework-shaped inbound/outbound traffic, a mock OpenAI tool call, source preview handling, and final delivery. It is deterministic and credential-free; it is not a live Microsoft tenant soak.
Current Main Compatibility
Compared against
origin/main78486e27511c945a01c7e719b7e271e437ffb7a2.git merge-tree --write-treecompleted without conflicts and produced treed0669b6f5cb4ee71ee494ffe20583107dc40ff17.AI Assistance
AI-assisted maintainer repair and review were used. The implementation was manually traced through the full Teams delivery path, reviewed with the repository autoreview skill, and validated with exact-tree tests and runtime proof.