Conversation
… Actor) Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 57a1ca1831
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This pull request fixes a critical bug where authentication session matching failed when the execution context injected framework metadata (CorrelationId and Actor) into the Options parameter. The framework automatically adds these metadata keys during execution, but the pattern matching logic was treating them as user-provided options, causing legitimate patterns to be rejected.
Changes:
- Added framework metadata filtering in
New-IdleAuthSessionBroker.ps1to excludeCorrelationIdandActorfrom pattern matching - Updated all matching paths (AuthSessionName-based and legacy) to use filtered user options
- Added comprehensive test coverage for framework metadata scenarios
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/IdLE.Core/Public/New-IdleAuthSessionBroker.ps1 | Added helper function to filter framework metadata keys from Options before pattern matching; updated all matching logic to use filtered options |
| tests/Core/New-IdleAuthSession.Tests.ps1 | Added new test context with 5 test cases covering framework metadata handling scenarios |
- Changed approach: only ignore framework metadata for AuthSessionName-only patterns - Multi-key patterns (including Actor/CorrelationId) now work for advanced routing - Added validation warnings when framework keys are used in patterns - Updated tests to cover Actor-based routing scenarios Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
- Added note to authentication walkthrough explaining reserved key behavior - Added detailed documentation to New-IdleAuthSession cmdlet reference - Explains when framework keys are ignored vs. when they participate in matching - Recommends using user-defined keys to avoid confusion Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
AuthSessionName-only patterns failed to match when the execution context injected
CorrelationIdandActormetadata into the Options parameter. The matching logic treated framework metadata as user-provided options, causing legitimate patterns to be rejected.Changes
New-IdleAuthSessionBroker.ps1: Implemented selective framework metadata handling for pattern matchingCorrelationId,Actor) is ignored during matchingNew-IdleAuthSession.Tests.ps1: Added comprehensive test coverage for framework metadata scenarios and actor-based routingDocumentation: Added guidance on framework-reserved keys
docs/use/walkthrough/05-providers-authentication.md)docs/reference/cmdlets/New-IdleAuthSession.md)CorrelationIdandActorin patternsExamples
Simple AuthSessionName-only pattern (framework metadata ignored)
Previously failed with "No matching auth session found":
Actor-based routing with multi-key patterns (framework metadata participates)
User-defined routing options (framework metadata ignored)
Framework-Reserved Keys
CorrelationIdandActorare automatically injected by the execution framework and have special handling:Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.