Repository navigation
Fix managed Copilot runtime discovery and startup validation - #3215
Open
George Ng (GeorgeNgMsft) wants to merge 1 commit into
Open
George Ng (GeorgeNgMsft) wants to merge 1 commit into
George Ng (GeorgeNgMsft) wants to merge 1 commit into
Conversation
Keep application assets separate from the runtime cache, share configured executable selection with reasoning, and verify SDK startup during runtime-only setup without requiring login. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0040b8ff-2701-4fb7-821f-760e05fe6b4b
Hillary Mutisya (hillary-mutisya)
approved these changes
Oct 24, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 25, 2026
Hillary Mutisya (hillary-mutisya)
pushed a commit
to hillary-mutisya/TypeAgent
that referenced
this pull request
Oct 31, 2026
## What changes Copilot already has a `run_macro` MCP tool, but its adapter rejects every call in bypass mode. This adds a default-off opt-in for explicit macro discovery and checked execution while ordinary prompts stay with Copilot. Set `TYPEAGENT_BYPASS_MACRO_TOOLS=true` before starting Copilot, or save `"bypassMacroTools": true` alongside `"mode": "bypass"` in the plugin config. The environment overrides the file setting. Invalid values are rejected rather than enabling access. The opt-in allows `list_macros`, `search_macros`, `inspect_macro`, `get_macro_requirements`, `run_macro`, and `get_macro_run`. Validation, approval, disablement, and deletion remain blocked in bypass. Both status surfaces distinguish macro availability from prompt routing. The README documents setup and the limits. ## What stays unchanged Execution uses the existing local owner and macro manager, including current approved-version checks, backend authorization, native session/workspace binding, cancellation, and durable run results. A disabled owner stays disabled. This does not enable automatic recipe matching, TypeAgent delegation, workspace tools, learning, or additional tool permissions. Unsupported tools and backend failures do not fall back to a planner or another provider. Capturing a trace still does not make it an executable macro. Calls aborted before or during owner connection now stop before dispatch; cancellation of an active run still forwards its preallocated run ID. This branch starts directly from main and is independent of the capture fix (microsoft#3214) and runtime discovery fix (microsoft#3215). ## Validation - Dependency-aware build and final plugin build passed. - Full plugin suite: 565 Jest tests, 3 extension-layout tests, and 12 launcher tests passed. - Nine new integration cases passed again after the final input-discovery/latest-version assertions. - Pinned Prettier check passed. - All four PR gates passed against origin/main on the committed change: lint, complexity, circular dependencies, and debt. - Direct adversarial review covered default-off behavior, malformed settings, all ten tool admissions, unchanged prompt routing, owner-off behavior, backend rejection, and cancellation. The follow-up adversarial review did not confirm a new blocking product defect. It closed a verification gap: the original happy-path tests mocked execution, while the real-owner test only rejected a missing macro. The new integration suite launches the actual bundled macro MCP server over stdio, connects to the real local owner/broker, executes an approved compiled program with the real RecipeExecutor/native host, and reads the durable result. Both environment and saved-config opt-ins succeed. Default-off/false/invalid flags, lifecycle operations, draft and disabled/stale versions, invalid inputs, and an inactive owner fail without native dispatch. A backend permission denial remains denied with exactly one call and no fallback. Only the native SDK/tool provider is a controlled read-tool fixture; this is not live native Copilot/backend end-to-end execution of a user's saved macro. The synthetic catalog is isolated, and no real learning preference or permission setting is changed. This PR does not claim additional tool replay support. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0040b8ff-2701-4fb7-821f-760e05fe6b4b
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.
Summary
Keep
TYPEAGENT_RUNTIME_ROOTfor bundled application assets, not the Copilot cache. Preserve the dedicated cache environment variable, platform defaults, and--runtime-rootoverride.Share executable selection between the model and reasoning clients. Honor
TYPEAGENT_COPILOT_CLI_PATHbeforeCOPILOT_CLI_PATH, while keeping explicit client paths and the credit-budget evaluation override ahead of both. Credit handling, isolated configuration, and permission handling are unchanged.Runtime-only setup now starts the selected runtime, checks SDK status, and stops the client before reporting success. It does not query authentication or models. Startup failures flow through the MSI's existing incomplete-setup warning path without rolling back installation; normal setup still requires sign-in.
Validation
Built
agent-dispatcherand its dependencies successfully. All 114 targeted tests passed:Prettier and the lint, complexity, circular-dependency, and code-debt ratchets passed. Completed a direct adversarial review with no outstanding findings.
Also ran the updated helper against a real cached Copilot 1.0.83 runtime with the application-root environment variable set and no dedicated cache override. Default lookup succeeded, followed by:
A clean MSI installation and end-to-end macro recording/replay were not run. The automated bundled-layout tests use an SDK test double; the separate local startup check used the real SDK and runtime.