fix(adapter-teams): resolve DM conversation IDs for Graph API#403
Merged
Conversation
…ssages
DM conversation IDs from Bot Framework are opaque and don't work with
Graph's /chats/{chat-id}/messages endpoint. Cache the user's AAD object
ID from incoming activities and construct the correct Graph chat ID
(19:{aadId}_{botId}@unq.gbl.spaces) via a new TeamsGraphContext union.
Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
@heyitsaamir is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
Remove redundant type checks — DMs never have threadMessageId so the channel guard doesn't need an explicit DM exclusion. Co-Authored-By: Claude <noreply@anthropic.com>
bensabic
approved these changes
Apr 20, 2026
grundmanise
pushed a commit
to grundmanise/vercel-chat-sdk
that referenced
this pull request
Apr 22, 2026
…#403) * fix(adapter-teams): resolve DM conversation IDs for Graph API fetchMessages DM conversation IDs from Bot Framework are opaque and don't work with Graph's /chats/{chat-id}/messages endpoint. Cache the user's AAD object ID from incoming activities and construct the correct Graph chat ID (19:{aadId}_{botId}@unq.gbl.spaces) via a new TeamsGraphContext union. Co-Authored-By: Claude <noreply@anthropic.com> * fix(adapter-teams): simplify graph context branching Remove redundant type checks — DMs never have threadMessageId so the channel guard doesn't need an explicit DM exclusion. Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
dancer
pushed a commit
that referenced
this pull request
Apr 30, 2026
* fix(adapter-teams): resolve DM conversation IDs for Graph API fetchMessages
DM conversation IDs from Bot Framework are opaque and don't work with
Graph's /chats/{chat-id}/messages endpoint. Cache the user's AAD object
ID from incoming activities and construct the correct Graph chat ID
(19:{aadId}_{botId}@unq.gbl.spaces) via a new TeamsGraphContext union.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(adapter-teams): simplify graph context branching
Remove redundant type checks — DMs never have threadMessageId so the
channel guard doesn't need an explicit DM exclusion.
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
5 tasks
patrick-chinchill
added a commit
to Chinchill-AI/chat-sdk-python
that referenced
this pull request
May 28, 2026
…IDs (#85) Two small upstream bug-fix ports. fix(slack): interactive-payload team_id through streaming context (vercel/chat#330) - Slack carries the workspace ID in different shapes for interactive payloads vs message events - Old extraction returned the entire team dict for block_actions, breaking streaming routing - New _extract_slack_recipient_team_id helper walks each shape in order fix(teams): canonical DM conversation ID for Microsoft Graph API (vercel/chat#403) - Bot Framework opaque DM IDs are rejected by Graph's /chats/{chat-id}/messages endpoint - Cache the user's AAD object ID into a new TeamsDmContext keyed by base conversation ID - Discriminated union TeamsGraphContext for DM vs channel dispatch - Backwards-compatible with pre-existing cached entries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fetchMessageswas returning 404 for DM conversations — the opaque Bot Framework conversation ID (a:...) doesn't work with Graph's/chats/{chat-id}/messagesTeamsGraphContextdiscriminated union (channel | dm) to cache the resolved Graph chat ID (19:{aadId}_{botId}@unq.gbl.spaces) fromactivity.from.aadObjectIdgetChannelContext→getGraphContextnow handles both channels and DMs through a single cache keyTest plan
fetchMessagesreturns messages instead of 404fetchMessagesstill works (unchanged code path)pnpm validatepasses (build, typecheck, lint, tests)chatIdFromContext(DM, null, channel contexts)