Conversation
Owner
|
@copilot pls start a new agent session to realize this pr |
…ovider key Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Contributor
Author
Done in commit Breaking change — root
All 691 tests pass. |
Copilot
AI
changed the title
[WIP] Align ContextResolver parameters with Step.With and document AuthSession support
Align ContextResolver parameters with Step.With and document AuthSession support
Feb 27, 2026
blindzero
approved these changes
Feb 27, 2026
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/IdLE.Core/Private/Invoke-IdleContextResolvers.ps1:21
- The help text claims AuthSession handling uses the “same pattern as step execution”, but the resolver implementation currently always swallows exceptions from default auth acquisition (
AcquireAuthSession('', $null)), whereasInvoke-IdleProviderMethodrethrows when the target provider method supportsAuthSession. This can cause resolvers to silently proceed without auth even when a provider supports/requires it. Please align the resolver’s default acquisition error handling with step behavior (or adjust the help text if the difference is intentional).
- Auth sessions are supported via With.AuthSessionName / With.AuthSessionOptions,
using the AuthSessionBroker in Providers (same pattern as step execution).
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Code Coverage Report
|
blindzero
approved these changes
Feb 27, 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.
Context Resolvers now use the same
With.*parameter shape as Steps. Root-levelProvideron a resolver entry is a breaking change — it is no longer a valid key and will fail schema validation.Changes Made
Schema validation (
Test-IdleWorkflowSchema.ps1)Providerfrom the ContextResolver allowed root keys (now onlyCapabilityandWithare permitted at resolver root).With.Provider(must be a non-empty string when present) andWith.AuthSessionOptions(must be a hashtable when present).Resolver execution (
Invoke-IdleContextResolvers.ps1)With.Providerinstead of the resolver root.With.Provider.Test fixtures and example workflows
tests/fixtures/workflows/resolver-*.psd1) and the mock example workflow (examples/workflows/mock/joiner-with-context-resolvers.psd1) updated to useWith.Provider.Documentation
docs/use/workflows/context-resolver.md: canonicalWith.*schema with a full parameter table coveringIdentityKey,Provider,AuthSessionName, andAuthSessionOptions; full example showingWith.AuthSessionNameusage withAuthSessionBroker; troubleshooting updated to referenceWith.Provider.docs/reference/capabilities.md: example updated to useWith.ProviderinsideWith.docs/reference/providers/_provider-name_template.md) and AD provider docs updated with a Context Resolvers section describing supported capabilities, output paths, and AuthSession applicability.New tests (
Test-IdleWorkflowSchema.Tests.ps1)Added schema validation tests:
Providerkey is rejected.With.Providerempty string is rejected.With.AuthSessionOptionsnon-hashtable is rejected.With.ProviderandWith.AuthSessionOptionsis accepted.Canonical ContextResolver schema
Testing
Original prompt
This section details on the original issue you should resolve
<issue_title>Align ContextResolver parameters with Step.With + document AuthSession support</issue_title>
<issue_description>## Problem Statement
Context Resolvers must behave exactly like Steps regarding parameter shape and provider/auth handling.
Today there are two inconsistencies:
Provider parameter shape is inconsistent
With.*(includingWith.Provider).Provideras a root-level key (outside ofWith).AuthSession is implemented but under-documented
With.AuthSessionNameandWith.AuthSessionOptionsfor Context Resolvers via the same AuthSessionBroker pattern as Steps.This issue is a breaking change by design:
Proposed Solution
1) Canonical ContextResolver schema (same as Steps)
Context Resolvers MUST use Step-like
With.*parameters:Rules:
Capabilitystays a required root key (unchanged).Providerat resolver root is removed (breaking; invalid schema).With.IdentityKeyis required per capability:IdLE.Identity.ReadIdLE.Entitlement.ListWith.Provideris optional, but provider selection MUST follow Step-like behavior (see below).With.AuthSessionName/With.AuthSessionOptionsare supported and MUST behave like Steps.2) Provider selection behavior (must match Steps)
Provider selection for Context Resolvers MUST be performed by the engine (not by providers), and MUST behave like Steps:
With.Provideris set: use that provider alias.With.Provideris not set:With.Provider).No “pick first”, no hidden ordering-based behavior.
3) AuthSession behavior (must match Steps)
Context Resolvers MUST use the same AuthSessionBroker mechanism as Steps:
With.AuthSessionNameis specified:Providers.AuthSessioninto provider methods that accept it (backwards-compatible via parameter detection).With.AuthSessionNameis specified:Security boundary:
With.AuthSessionOptionsmust be a hashtable.AuthSessionOptionsare rejected (same guardrails as Steps).4) Implementation changes
4.1 Workflow schema validation
Update
IdLE.Core/Private/Test-IdleWorkflowSchema.ps1:CapabilityWithProviderfrom the allowlist.Withmust be a hashtable if present.With.Providermust be a non-empty string if present.With.AuthSessionOptionsmust be a hashtable if present.Capability-specific required keys like
With.IdentityKeyare validated at dispatch time (see below), but may also be enforced at schema-validation time if desired (optional).4.2 Resolver execution
Update
IdLE.Core/Private/Invoke-IdleContextResolvers.ps1:With.Provider(not from resolver root).Invoke-IdleProviderMethodbehavior).With.IdentityKeyfor current allowlisted capabilities).5) Documentation updates (required)
Update docs (no legacy notes, no migration section, no deprecated comments):
docs/use/workflows/...:With.ProviderWith.IdentityKey,With.Provider,With.AuthSessionName,With.AuthSessionOptionsWith.AuthSessionName)Request.Context.*Alt...
💡 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.