fix: add product context fallback for subchannels#133
Open
fpfp100 wants to merge 5 commits into
Open
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…riveChannelObject Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ports the “subchannel fallback” behavior by resolving a subchannel from activity.channelIdSubChannel with a fallback to activity.channelData.productContext, and applies it consistently across hosting utilities so channel metadata is derived uniformly.
Changes:
- Added a shared
resolveSubChannel()helper and used it fromgetChannelBaggagePairs()andScopeUtils.deriveChannelObject(). - Extended
ActivityLiketo includechannelData, enablingproductContextfallback support. - Added unit tests covering the fallback and precedence rules.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/internal/unit/a365/hosting/turnContextUtils.test.ts | Adds unit tests for resolveSubChannel and verifies getChannelBaggagePairs fallback behavior. |
| test/internal/unit/a365/hosting/scopeUtils.test.ts | Adds unit tests ensuring ScopeUtils.deriveChannelObject() uses the same fallback. |
| src/a365/index.ts | Re-exports resolveSubChannel from the public A365 entrypoint. |
| src/a365/hosting/types.ts | Adds channelData?: unknown to ActivityLike so callers can pass productContext. |
| src/a365/hosting/turnContextUtils.ts | Introduces resolveSubChannel and updates channel baggage extraction to use it. |
| src/a365/hosting/scopeUtils.ts | Updates deriveChannelObject() to use resolveSubChannel. |
| src/a365/hosting/index.ts | Re-exports resolveSubChannel from the hosting barrel. |
| .claude/settings.local.json | Adds a Claude local settings file with allowed Bash commands. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+94
to
+106
| export function resolveSubChannel(activity: ActivityLike | undefined): string | undefined { | ||
| let subChannel = activity?.channelIdSubChannel as string | undefined; | ||
| if (!subChannel) { | ||
| try { | ||
| const rawChannelData = activity?.channelData; | ||
| let channelData: Record<string, unknown> | undefined; | ||
| if (typeof rawChannelData === "string") { | ||
| channelData = JSON.parse(rawChannelData) as Record<string, unknown>; | ||
| } else if (rawChannelData && typeof rawChannelData === "object") { | ||
| channelData = rawChannelData as Record<string, unknown>; | ||
| } | ||
| if (channelData && typeof channelData.productContext === "string") { | ||
| subChannel = channelData.productContext as string; |
Comment on lines
+3
to
+12
| "allow": [ | ||
| "Bash(gh pr:*)", | ||
| "Bash(gh issue:*)", | ||
| "Bash(gh run:*)", | ||
| "Bash(npx prettier:*)", | ||
| "Bash(git add:*)", | ||
| "Bash(git commit:*)", | ||
| "Bash(git push:*)", | ||
| "Bash(gh workflow:*)" | ||
| ] |
hectorhdzg
reviewed
May 11, 2026
| @@ -0,0 +1,14 @@ | |||
| { | |||
| "permissions": { | |||
Member
There was a problem hiding this comment.
Lets remove local setting from the PR then we can merge
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
MattB-msft
approved these changes
May 12, 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.
fix: add product context fallback for subchannels
Ports the subchannel fallback from SDK PR:microsoft/Agent365-nodejs#251.
Additionally, extracted a shared
resolveSubChannelhelper inturnContextUtilsand applied the same fallback toScopeUtils.deriveChannelObject(), which was still readingchannelIdSubChanneldirectly without theproductContextfallback.