Add support for subChannels being stored in entities#697
Merged
Conversation
Contributor
Author
|
TO DO:
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds support for representing subchannels via a ProductInfo entity and introduces getters/setters to combine primary channel and subchannel into a composite channelId while normalizing serialization to keep only the primary channel in wire payloads.
- Introduces ProductInfo entity and helper for adding it to activities.
- Replaces direct channelId storage with internal _channelId plus computed accessors (channelId, channelIdChannel, channelIdSubChannel).
- Normalizes outgoing activities to replace _channelId with channelId and updates serialization logic.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| packages/agents-hosting/src/activityWireCompat.ts | Normalizes outgoing payload by moving _channelId to channelId. |
| packages/agents-activity/src/activity.ts | Adds internal _channelId plus composite channelId accessors and updated serialization logic. |
| packages/agents-activity/src/entity/productInfo.ts | Defines ProductInfo entity and helper for attaching it to an Activity. |
| packages/agents-activity/test/activity/activity.subChannels.test.ts | Adds tests covering composite channelId behavior and serialization. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Member
tracyboehrer
left a comment
There was a problem hiding this comment.
Passing Activity.channelId to the various UserTokenClient operation could cause an issue. Unclear if ABS will handle the full channelId. DotNet will use just the "channel" portion for those calls.
tracyboehrer
approved these changes
Oct 20, 2025
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.
This PR adds support for the
ProductInfoentity, and adds some helper functions around the use of the channelId field.Resolves #533
New:
activity.channelId = 'foo:bar' works
activity.channelIdChannel = 'foo' works
activity.channelIdSubChannel = 'bar' works
How this works:
Under the hood, we have getter/setter functions for channelId and the other sub-fields.
The "legacy" value of channelId from the wire is stored in _channelId.
The entity is stored as transmitted.
Deserialization works as expected with no change.
During serialization, we move the value from _channelId to channelId. This happens in both toJsonString and in the noramalizeOutgoingActivity method.
GOTCHAS:
If a user does JSON.stringify(activity) they will end up with _channelId instead of channelId