Skip to content

Commit 419da85

Browse files
committed
fix(msteams): include sessionKey in canonical hook context
Addresses ClawSweeper review finding [P2] on PR #82354. Pass `params.sessionKeyForInternalHooks` as the `sessionKey` field of the canonical hook context built in `buildMSTeamsSentHookContext`, not just as the internal-hook routing key. Telegram's `buildTelegramSentHookContext` does not include sessionKey either — but the canonical context type accepts it, and the plugin-SDK consumers reading the canonical/plugin context object (via `toPluginMessageContext`) can use it to correlate the sent event with the originating agent session. Including it costs nothing.
1 parent 26b1178 commit 419da85

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

extensions/msteams/src/delivery-hooks.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ function buildMSTeamsSentHookContext(params: EmitMSTeamsMessageSentHookParams) {
6969
channelId: "msteams",
7070
accountId: params.accountId,
7171
conversationId: params.conversationId ?? params.to,
72+
// Include the session key in the canonical hook context (not just as the
73+
// internal-hook routing key) so plugin-SDK consumers reading the
74+
// canonical/plugin context object can correlate the sent event with
75+
// the originating agent session.
76+
sessionKey: params.sessionKeyForInternalHooks,
7277
messageId: params.messageId,
7378
isGroup: params.isGroup,
7479
groupId: params.groupId,

0 commit comments

Comments
 (0)