microsoft / microsoft/teams.ts
Handle targeted channel messages received as root messages
- Dominant language
- TypeScript
- Stars
- 107
- Forks
- 39
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 74
Description
## Problem
In Teams channels, a targeted message can arrive as a root message. The Teams platform currently does not allow that message to be answered through the normal targeted-reply path, so an SDK response using the provided reply semantics fails and no response is sent.
The response must instead be posted as a new root message in the channel while remaining targeted to the initiating user.
## Expected SDK behavior
When handling a targeted channel message, the SDK should determine from the incoming message URL/context whether the message is a root message:
- For a targeted message in a reply chain, preserve the existing targeted-reply behavior.
- For a targeted message at the channel root, send the response as a targeted root message rather than as a targeted reply.
This should be handled by the SDK so applications do not need a platform-specific workaround or need to reconstruct the appropriate send URL themselves.
## Reproduction
1. In a Teams channel, send a targeted root message to an agent (for example, invoke the agent from the channel root).
2. Have the agent respond using the SDK's normal reply mechanism.
3. Observe that the reply fails and no message is delivered.
## Current workaround
Detect that the incoming targeted message is a root message and post a new targeted root message instead of replying to it.
Contributor guide
Research direction
Start by tracing the SDK's normal reply mechanism and how it reads the incoming message URL/context for targeted channel messages. Reproduce the root-message failure, then verify that reply-chain messages retain the existing behavior while root messages are delivered as targeted root messages without application-side URL reconstruction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100