msteams: allow replyStyle config override for DMs#27765
msteams: allow replyStyle config override for DMs#27765mattjcorner wants to merge 1 commit intoopenclaw:mainfrom
Conversation
DM conversations were hardcoded to replyStyle "thread", which reuses the original webhook TurnContext. Bot Framework revokes this proxy after the HTTP handler returns (~15-30s). When agent processing takes longer (LLM inference, tool calls), the final reply hits the revoked proxy and fails silently — the user sees "Let me try..." but never gets the actual response. The "top-level" replyStyle uses adapter.continueConversation() which creates a fresh TurnContext per send with no expiry. This change lets DMs respect the same config cascade (channel → team → global) as group conversations, defaulting to "thread" for backwards compat. Operators hitting proxy-revoked errors in DMs can now set replyStyle: "top-level" in their msteams channel config. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Greptile SummaryReplaces hardcoded Changes:
Why this matters: Confidence Score: 5/5
Last reviewed commit: 4e3d709 |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Hi @mattjcorner — 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 @mattjcorner — 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
Direct message conversations currently hardcode
replyStyle: "thread"inresolveMSTeamsReplyPolicy(), ignoring any config override. This causes reply failures in DMs when agent processing exceeds the Bot Framework TurnContext lifetime.The problem: The
"thread"reply style reuses the original webhook TurnContext. Bot Framework revokes this TurnContext proxy after the HTTP handler returns (~15-30 seconds). When agent processing takes longer — LLM inference, tool calls, multi-step workflows — the final reply attempt hits the revoked proxy and fails silently:The user sees the agent's "thinking" preamble but never receives the actual response.
The fix: The
"top-level"reply style usesadapter.continueConversation()which creates a fresh TurnContext per send — no proxy expiry issue. This change makes DMs respect the same config cascade (channelConfig → teamConfig → globalConfig) as group conversations, while preserving"thread"as the default for backwards compatibility.After this change, operators hitting proxy-revoked errors in DMs can set
replyStyle: "top-level"in their msteams channel config to resolve the issue.Changes
extensions/msteams/src/policy.ts: Replace hardcoded"thread"return for DMs with config cascade resolution (same pattern as non-DM path), defaulting to"thread"extensions/msteams/src/policy.test.ts: Update test to verify default behavior + add test for config overrideTest plan
pnpm test -- --run extensions/msteams/src/policy.test.ts— all 17 tests passreplyStyle: "top-level"in msteams config — verify DM replies deliver reliably regardless of agent processing time"thread"(backwards compat)🤖 Generated with Claude Code