.NET: .NET: fix: Forward x-agent-user-id to toolbox proxy to resolve OAuth consent binding #8379 - #8561
Open
sunoj (sun-9545sunoj) wants to merge 4 commits into
Open
.NET: .NET: fix: Forward x-agent-user-id to toolbox proxy to resolve OAuth consent binding #8379#8561sunoj (sun-9545sunoj) wants to merge 4 commits into
sunoj (sun-9545sunoj) wants to merge 4 commits into
Conversation
sunoj (sun-9545sunoj)
deployed
to
github-app-auth
September 20, 2026 18:11 — with
GitHub Actions
Active
sunoj (sun-9545sunoj)
deployed
to
github-app-auth
September 20, 2026 18:11 — with
GitHub Actions
Active
sunoj (sun-9545sunoj)
deployed
to
github-app-auth
September 20, 2026 18:12 — with
GitHub Actions
Active
Author
|
@microsoft-github-policy-service agree |
sunoj (sun-9545sunoj)
deployed
to
github-app-auth
September 21, 2026 07:43 — with
GitHub Actions
Active
sunoj (sun-9545sunoj)
deployed
to
github-app-auth
September 21, 2026 13:07 — with
GitHub Actions
Active
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.
Motivation & Context
its
oauth_consent_requestwas being bound to the container's managed identity rather than the calling user.This caused sign-in to fail with
Code <id> not foundon the callback.addition to
CallId.- Updated
AgentFrameworkResponseHandlerto re-applyHostedCallContext.UserIdalongsideCallIdatyield boundaries, ensuring the user ID is correctly scoped per request.
- Updated
FoundryToolboxBearerTokenHandlerto forward thex-agent-user-idHTTP header during egress tothe toolbox proxy, mirroring the existing behavior for
x-agent-foundry-call-id.- What is the impact of these changes?
- The toolbox proxy will now resolve the server-side caller context for the human user rather than
defaulting to the container's Azure Managed Identity. This guarantees that the OAuth consent link generated
(
CONSENT_REQUIRED) correctly binds to the caller, allowing the sign-in and subsequent tools lookup to succeed.- What do you want reviewers to focus on?
- Verify that the yield boundaries and egress interception in
AgentFrameworkResponseHandlerproperlyreapply the
UserId.framework/blob/main/CONTRIBUTING.md)
- [x] This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
- [x] This is not a breaking change.