Repository navigation
Post Plan completion to the reply chain in 1:1 threads - #722
Merged
Merged
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change to keep plan completions in the originating chat reply chain.
No open issues 🎉
What changed in this PR
Updates Plan.CompleteAsync to post in the originating reply chain for threaded 1:1 chats, matching ctx.send placement while preserving conversation routing for typing updates and channels.
Changes:
- Adds optional, serializable reply-chain placement to
PlanandPlanOptions. - Preserves placement when rebuilding a Plan, including in the proactive PlanBot sample.
- Adds tests for completion routing, typing routing, and compatibility with saved options lacking a reply chain.
| File | Description |
|---|---|
test/Microsoft.Teams.Apps.UnitTests/PlanTests.cs |
Tests restored placement, typing routing, and saved-shape compatibility. |
test/Microsoft.Teams.Apps.UnitTests/ContextReplyChainPlacementTests.cs |
Tests context-derived routing for chat threads, top-level chats, and channels. |
src/Microsoft.Teams.Apps/PlanOptions.cs |
Adds optional ReplyChain and the experimental PlanReplyChain type. |
src/Microsoft.Teams.Apps/Plan.cs |
Captures and validates placement, routing completions into chat reply chains. |
samples/PlanBot/PlanDemo.cs |
Saves reply-chain placement for delayed completion. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Corina (corinagum)
force-pushed
the
cg/glowing-guacamole
branch
from
November 5, 2026 01:55
bb8b5c1 to
a506ab3
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Lily Du (lilyydu)
approved these changes
Nov 5, 2026
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
Plan.CompleteAsyncnow lands in the thread of the message the user acted on in a 1:1 chat, the same placectx.sendputs it.Before,
Plansent every activity toPOST /v3/conversations/{id}/activities. A bare 1:1conversation.idcarries no thread, so the completion landed at the top level of the chat. Channels were not affected, because the channelconversation.idalready carries;messageid={root}.Plan.CreateFromContextnow reads the inbound reply chain placement fromchannelDataand stores it on the Plan asReplyChain, for chats only. A standaloneCompleteAsyncthen callsCreateReplyChainActivityAsync. The SDK does not read or modifyconversation.id.A Plan rebuilt from saved
PlanOptionskeeps its placement.ReplyChainis omitted from JSON when null, so previously saved shapes load and re-serialize unchanged. ThePlanBotsample's proactive flow now savesReplyChainalong with the two IDs.Typing updates (start, update, stop, error) stay on the conversation.
ReplyToIdis still set on every Plan activity.Public API change
New optional
ReplyChainonPlanOptionsandPlan, and a newPlanReplyChaintype (ChatOrChannelId,ReplyChainId). Both are under the existingExperimentalTeamsPlanattribute.Testing
Unit tests cover a rebuilt Plan completing in its chain, typing staying on the conversation, a saved shape without a chain, and the
CreateFromContextfill for a 1:1 thread, a top-level message and a channel thread.No integration test was added, because the integration suite has no existing Plan coverage.