feat(msteams): per-call topLevel override on send action for proactive new channel threads#93292
feat(msteams): per-call topLevel override on send action for proactive new channel threads#93292leen109 wants to merge 1 commit into
Conversation
Adds a `topLevel: true` option to the msteams `message`/`send` action so the bot can post a fresh root post / new thread in a channel without having to flip the static `channels.msteams.replyStyle` config. The static config is correct for @mention replies (which must stay inside their thread), but proactive announcements, warehouse warnings, and cross-team broadcasts need to surface as new root posts. Today the only way to get a new thread is to set `replyStyle: "top-level"` for the whole channel, which then breaks in-thread replies. Changes: - `send-context.ts`: `resolveMSTeamsSendContext` accepts an optional `replyStyleOverride` and honors it before the config-derived `resolveMSTeamsProactiveReplyStyle` lookup. - `send.ts`: `SendMSTeamsMessageParams` accepts `replyStyleOverride`, forwards it into the send context. - `channel.ts`: `describeMSTeamsMessageTool` exposes a `topLevel` boolean on the `send` action schema. `handleAction` has a new branch for `send + !presentation + topLevel: true` that routes through `sendMessageMSTeams` with `replyStyleOverride: "top-level"`. - `send-context.test.ts`: two new tests — override honored, fallback to config when omitted. Backwards compatible: omitting `topLevel` leaves the existing reply behavior untouched. Ignored for DM/group-chat conversation types (they already default to `top-level`). Refs openclaw#93288
|
Codex review: needs real behavior proof before merge. Reviewed June 30, 2026, 11:16 PM ET / 03:16 UTC. Summary PR surface: Source +62, Tests +67. Total +129 across 4 files. Reproducibility: yes. source-level: current main exposes no Teams send-scoped Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Proof path suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Carry Do we have a high-confidence way to reproduce the issue? Yes, source-level: current main exposes no Teams send-scoped Is this the best way to solve the issue? No as implemented. The per-call override seam is the right narrow direction, but the patch needs to preserve or explicitly reject supported send payload combinations and supply real Teams proof. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fa3c9de45965. Label changesLabel justifications:
Evidence reviewedPR surface: Source +62, Tests +67. Total +129 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
|
This pull request has been automatically marked as stale due to inactivity. |
Closes the gap surfaced in #93288.
Summary
Adds a
topLevel: trueoption to the msteamsmessage/sendaction so the bot can post a fresh root post / new thread in a channel without flipping the staticchannels.msteams.replyStyleconfig (which is correctly set to"thread"for the @mention reply path).Motivation
Two distinct behaviors are needed in the same channel:
replyStyle: "thread"): bot is @mentioned inside a thread → reply lands in the same thread.Globally setting
replyStyle: "top-level"is not acceptable because it breaks (1). There is currently no per-call override.Changes
send-context.ts:resolveMSTeamsSendContextaccepts an optionalreplyStyleOverride: MSTeamsReplyStyleand honors it before the config-derivedresolveMSTeamsProactiveReplyStyle()lookup.send.ts:SendMSTeamsMessageParamsacceptsreplyStyleOverrideand forwards it.channel.ts:describeMSTeamsMessageToolexposes atopLevelboolean on thesendaction schema.handleActionhas a new branch forsend+!presentation+topLevel: truethat routes throughsendMessageMSTeamswithreplyStyleOverride: "top-level".send-context.test.ts: two new tests — override honored, fallback to config when omitted.Backwards compatibility
Omitting
topLevelleaves all existing behavior untouched.topLevel: trueis silently ignored for DM/group-chat conversation types (they already default totop-levelregardless). Card sends (withpresentation) keep their existing path; extendingsendAdaptiveCardMSTeamsis left as a follow-up.Test plan
extensions/msteams/src/send-context.test.ts— override honored vs. config fallback.topLevel: true, send goes out without the;messageid=suffix on the conversation reference, surfaces as a fresh root post in a Posts-style channel;topLevelomitted leaves the in-thread reply behavior untouched.Sample usage
{ "channel": "msteams", "action": "send", "target": "conversation:19:[email protected]", "topLevel": true, "message": "Warehouse alert: incoming delivery delayed." }