-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
feat(msteams): Add Graph API-based message history query (readMessages action) #11346
Description
Summary
The msteams plugin docs describe Graph API permissions enabling historical message queries, but the plugin doesn't implement a readMessages action. Discord and Slack both support this. Teams should too, especially since Graph permissions (ChannelMessage.Read.All, Chat.Read.All) are already documented as prerequisites.
Use Case
After session compaction, the agent loses raw conversation history. Being able to query recent Teams messages via Graph would let the agent reconstruct context that was lost during compaction, rather than relying solely on the compaction summary and memory files.
This would also help with:
- Catching up on messages received while the gateway was offline
- Providing the agent with accurate message history for reference
Current State
- Graph API permissions are documented in the msteams docs (RSC vs Graph API)
- The plugin uses Graph for media/attachment downloads (
attachments/graph.ts) historyLimitanddmHistoryLimitonly limit locally stored session turns, not Graph queries- The
messagetool for msteams only supportspollandsendactions - Discord and Slack already have
readMessagesactions
Proposed
Add a readMessages (or similar) action to the msteams plugin that queries the Graph API /chats/{id}/messages and /teams/{teamId}/channels/{channelId}/messages endpoints, consistent with how Discord and Slack implement it.