Dynamic typed actions for approved mcp macros - #3118
Merged
Merged
Conversation
Publish approved macros through a dynamic agent provider for translation and learned grammar routing. Add version-safe replay, cancellation, catalog refresh, feature gating, and structured Copilot runner handoffs while preventing duplicate or trailing execution.
Learn reusable macros from a selected task the user has already executed, without requiring manual creation, validation, approval, or training runs. - Add durable recipe extraction, generalized macro building, and validation. - Support workspace learning modes: Off, Prepare, Read-only, and All. - Generate and register version-bound grammar for natural-language reuse. - Preserve live tool permissions by routing learned macros through Copilot's whole-procedure runner; prevent callers from forcing raw replay. - Add recording, learning preference, status, and cancellation controls. - Isolate generated grammar from shared phrase sets and helper-rule collisions. - Validate exact inputs, changed values, negative intents, and competing routes. - Use NFA-compatible optimizations for compiled grammar artifacts. - Document the implemented pipeline, retry procedure, and remaining work. Validation: integrated builds, 502 tests across 31 suites, formatting, and quality gates pass. Live WorkIQ validation, automatic adaptation capture, and hosted-reasoning producer integration remain pending.
Hillary Mutisya (hillary-mutisya)
requested a review
from George Ng (GeorgeNgMsft)
October 1, 2026 16:56
George Ng (GeorgeNgMsft)
approved these changes
Oct 1, 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.
This pull request introduces several enhancements and infrastructure changes to support robust, versioned macro action routing and NFA-compatible grammar artifacts for Copilot Fast Actions. The most significant changes are the addition of dynamic typed actions for approved macros, improvements to macro lifecycle and routing, and the introduction of a new grammar optimization preset to ensure compatibility with NFA-based matchers. The agent server and SDK have also been extended to support macro learning preferences and job management.
Macro Action Routing and Lifecycle Enhancements:
macrosagent, with dynamic routing, version/source fingerprinting, and session lifecycle refresh. This enables direct invocation and learned grammar routing for macros, and ensures that removed or replaced macros are invalidated and not executed. [1] [2] [3]Grammar Optimization and Artifact Compatibility:
nfaCompatibleOptimizationsinactionGrammar, disabling tail optimizations that are incompatible with NFA matchers. The artifact compiler now uses this preset by default, and a new test verifies round-trip NFA matching of optimized artifacts. [1] [2] [3] [4] [5] [6]Agent SDK and Protocol Extensions:
AgentHandoffto the SDK and extendedActionResultSuccessto support agent handoff payloads, enabling structured macro runner handoff. [1] [2] [3]Agent Server Integration: