fix(msteams): send pairing challenge reply on unpaired DMs#62812
fix(msteams): send pairing challenge reply on unpaired DMs#62812neeravmakwana wants to merge 1 commit into
Conversation
Greptile SummaryThis PR fixes a missing pairing reply for MS Teams DMs under Confidence Score: 5/5Safe to merge — a focused, well-tested bug fix with no architectural changes or security surface expansion. All findings are P2 or lower (no blocking issues). The fix uses the established shared No files require special attention.
|
Summary
channels.msteams.dmPolicy=pairing, unpaired users had pairing requests recorded on disk but received no Teams message with the pair code, making first-time setup depend on host access tomsteams-pairing.jsonor CLI listing.issuePairingChallengepath (pairing.issueChallenge): on the first pairing upsert for a sender it sends the standard pairing text viacontext.sendActivity, and logsmsteams pairing requestwithsender,code, andlabelat info; reply failures are logged at error.issuePairingChallenge).Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
upsertPairingRequestdirectly and never invoked the shared pairing challenge flow that sends the in-channel reply on newly created requests.Regression Test Plan (if applicable)
extensions/msteams/src/monitor-handler/message-handler.authz.test.tsdmPolicy=pairingtriggerssendActivitywith the mocked pair code and logsmsteams pairing requestwith that code.issueChallengeto the Bot Framework reply path without needing a live Teams tenant.upsertPairingRequest.User-visible / Behavior Changes
dmPolicy=pairingreceive the standard OpenClaw pairing message in Teams on first contact (with the pair code and approve instructions), consistent with other channels usingissuePairingChallenge.Diagram (if applicable)
N/A
Security Impact (required)
No)No)No— uses existing Bot FrameworksendActivityfor the active turn)No)No)Yes, explain risk + mitigation: N/ARepro + Verification
Environment
pnpmchannels.msteams.dmPolicy=pairingSteps
pnpm test:extension msteamsand scopedpnpm test extensions/msteams/src/monitor-handler/message-handler.authz.test.tspnpm checkExpected
Actual
Evidence
Human Verification (required)
pnpm checkafter changes.created: truepairing upsert; repeatcreated: falsecontinues to skip duplicate pairing replies per sharedissuePairingChallengebehavior.Review Conversations
Compatibility / Migration
Yes)No)No)Risks and Mitigations
sendActivitycould fail for misconfigured bots or transient Teams errors.