fix(msteams): respect thread context in proactive send path#78299
fix(msteams): respect thread context in proactive send path#78299feiskyer wants to merge 1 commit intoopenclaw:mainfrom
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path. Real behavior proof Next step before merge Review detailsBest possible solution: Retry the Codex review after fixing the execution failure. Do we have a high-confidence way to reproduce the issue? Unclear. The review failed before ClawSweeper could establish a reproduction path. Is this the best way to solve the issue? Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 98cbf7f11c35. |
|
Added behavioral proof in 59ea6bc: send.test.ts (+4 tests):
messenger.test.ts (+2 tests):
All 44 tests pass (13 send + 31 messenger). |
The proactive send path in send.ts hardcodes replyStyle: "top-level", causing all proactive/CLI messages to land as new top-level channel posts regardless of thread context. Additionally, messenger.ts throws when replyStyle is "thread" but no turn context is available. Two changes: 1. send.ts: resolve replyStyle from conversation context (channel + thread root → "thread", otherwise → "top-level") 2. messenger.ts: fall back to sendProactively with thread targeting instead of throwing when no turn context is available Fixes openclaw#78298
59ea6bc to
4669f05
Compare
Summary
send.tshardcodesreplyStyle: "top-level", causing all proactive/CLI messages to land as new top-level channel posts regardless of thread context.send.tsresolvesreplyStyledynamically from conversation context;messenger.tsfalls back to proactive send with thread targeting instead of throwing.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
sendTextWithMedia→sendMSTeamsMessages→sendProactivelychain with mocked Bot Framework adapter.pnpm test extensions/msteams/src/send.test.tsandpnpm test extensions/msteams/src/messenger.test.tsreplyStyle: "thread"is passed for channel+threadId conversations and that the proactive fallback constructs;messageid=<threadRootId>conversation IDs.sendProactively(messages, 0, resolvedThreadId)which builds19:abc@thread.tacv2;messageid=thread-root-msg— proven by captured adapter reference in test.sendMSTeamsMessageswas always called withreplyStyle: "top-level"(hardcoded at old line 399 of send.ts).Root Cause (if applicable)
sendTextWithMedia()hardcodedreplyStyle: "top-level"instead of resolving from conversation context. Additionally,sendMSTeamsMessages()threw whenreplyStyle === "thread"with no turn context, blocking the proactive path from threading.replyStylevalue passed tosendMSTeamsMessagesfrom the proactive send path.Regression Test Plan (if applicable)
extensions/msteams/src/send.test.ts,extensions/msteams/src/messenger.test.tsreplyStyle: "thread"; no-context thread sends fall back to proactive with thread targeting.User-visible / Behavior Changes
Diagram (if applicable)
Security Impact (required)
Repro + Verification
Environment
Steps
threadIdExpected
Actual
Evidence
Human Verification (required)
Review Conversations
Compatibility / Migration
Risks and Mitigations
threadIdoractivityIdcould miss the thread routing."top-level"when neither field is present — same behavior as before this fix.