fix(msteams): isolate thread sessions, outbound targeting, and attachment resolution#59294
fix(msteams): isolate thread sessions, outbound targeting, and attachment resolution#59294atharva-getboon wants to merge 12 commits intoopenclaw:mainfrom
Conversation
…ion/history/store
Greptile SummaryThis PR fixes cross-thread context bleed in the MS Teams channel by introducing per-thread session keys, thread-scoped history, and outbound Key changes:
Confidence Score: 3/5
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9213f05201
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…ape <> in bot name regex
…read-aware debounce key
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eaee7238d8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…name breaking /slash commands
bd5109a to
35d331d
Compare
There was a problem hiding this comment.
💡 Codex Review
After this change, entry.text can start with preserved mentions (for example @Alice /status), so hasControlCommand(entry.text, cfg) returns false and the message is incorrectly debounced. That lets mention-prefixed slash commands be coalesced with subsequent messages in the debounce window, which can delay or alter command handling compared to the previous non-debounced path. The debounce gate should check entry.commandText (or another mention-stripped form) so command messages still bypass debounce reliably.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…tion-prefixed slash commands
…olation-58615 # Conflicts: # extensions/msteams/src/inbound.ts # extensions/msteams/src/monitor-handler/inbound-media.test.ts # extensions/msteams/src/monitor-handler/inbound-media.ts # extensions/msteams/src/monitor-handler/message-handler.ts
Summary
Fixes #58615 — msteams channel threads share the same session key, causing cross-thread context bleed.
resolveThreadSessionKeys(), gated bysession.threadBindings.enabledconfighistoryKeyis now thread-aware sobuildPendingHistoryContextFromMapdoesn't mix channel-level and thread-level historybuildActivity()setsactivity.replyToIdbefore any early returns so proactive sends (text + file attachments via SharePoint/OneDrive) land in the correct threadstripMSTeamsBotMentionTag()strips only the bot's<at>tag — other user mentions are preserved as@Namein agent context. A separatecommandText(all mentions stripped) is used for slash command detection to avoid regressions.toLowerCase()across session key, history key, and conversation store key derivationsreplyToIdwhen thread bindings enabled, preventing cross-thread message mergingAI-Assisted PR 🤖
Test plan
pnpm tsgo) cleanpnpm check) cleanpnpm build) cleanstripMSTeamsBotMentionTag(10 cases)buildActivityreplyToId thread targeting (3 cases)activity.replyToIdland in correct Teams thread🤖 Generated with Claude Code