Fix agent cache isolation by blueprint and agent - #4076
Open
Nilesh Choudhary (4gust) wants to merge 5 commits into
Open
Nilesh Choudhary (4gust) wants to merge 5 commits into
Nilesh Choudhary (4gust) wants to merge 5 commits into
Conversation
Partition agent client and token caches by the selected blueprint configuration and parent identity. Preserve named credential selection for app-only and UserFIC acquisition, including refresh tokens and account lookups, without changing refresh semantics. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Iarek Kovtunenko (iarekk)
approved these changes
Sep 29, 2026
| keyBuilder.Append(credentialId); | ||
| if (mergedOptions.AgentCachePartition is not null) | ||
| { | ||
| keyBuilder.Append(":agent-parent:"); |
There was a problem hiding this comment.
Why do we care about having even more CCA objects when they all share a cache? If the tokens are to be distinguished in the cache, then we should use MSAL extensiblity like WithCacheComponents("blueprint", id) ?
| } | ||
|
|
||
| [Fact] | ||
| public void GetApplicationKey_AgentParentPartitions_DoNotMutateOriginalOptions() |
There was a problem hiding this comment.
Can we have an E2E test with 1 blueprint and 2 agents please? We should clearly see that all operations are safe, by parsing the token and asserting the agentic claims.
Bogdan Gavril (bgavrilMS)
requested changes
Sep 29, 2026
Bogdan Gavril (bgavrilMS)
left a comment
Member
There was a problem hiding this comment.
Need E2E test
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The sole earlier PR implementation at dde08d3 is superseded by the reviewed implementation. Retain the reviewed tree unchanged while preserving both histories. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Avery-Dunn
reviewed
Sep 30, 2026
Avery-Dunn
reviewed
Sep 30, 2026
Apply the pair partition after caller options and callbacks. Cover query and callback overrides, remove the unconfigured E2E case, and restore the original READMEs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Avery-Dunn
approved these changes
Oct 1, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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 agent cache isolation by blueprint and agent
Prevent cross-blueprint reuse of cached agent clients and tokens.
Description
Use one blueprint+agent hash for both caches. The four-step live E2E and 73 unit tests pass; the separate same-blueprint/two-agent E2E awaits its second fixture.
Fixes: N/A (no linked issue).