Sitelet https://github.com/microsoft/TypeAgent/pull/3118
Skip to content

Dynamic typed actions for approved mcp macros - #3118

Merged
Hillary Mutisya (hillary-mutisya) merged 4 commits into
mainfrom
dev/hillarym/macros2
Oct 1, 2026
Merged

Hillary Mutisya (hillary-mutisya) merged 4 commits into
mainfrom
dev/hillarym/macros2

Conversation

@hillary-mutisya

Copy link
Copy Markdown
Collaborator

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:

  • Approved macros are now published as typed actions by the macros agent, 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]
  • Documentation and status tracking have been updated to reflect the new macro action routing, lifecycle refresh, and runner handoff capabilities. [1] [2]

Grammar Optimization and Artifact Compatibility:

  • Introduced nfaCompatibleOptimizations in actionGrammar, 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:

  • Added AgentHandoff to the SDK and extended ActionResultSuccess to support agent handoff payloads, enabling structured macro runner handoff. [1] [2] [3]
  • Extended the agent server protocol and client to support macro learning preferences and job management, including new methods for getting/setting preferences and preparing/canceling jobs. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Agent Server Integration:

  • The in-process agent server now configures the macro manager with learning runtime and registers the macro app agent provider, ensuring that macro actions are available and routable in all deployment modes. [1] [2]

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 (hillary-mutisya) changed the title Dynamic typed actions for approved macros Dynamic typed actions for approved mcp macros Oct 1, 2026
Merged via the queue into main with commit 7e9280f Oct 1, 2026
31 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants