Update PowerShell dev actions and namespace handlers - #2849
Merged
Hillary Mutisya (hillary-mutisya) merged 5 commits intoAug 13, 2026
Merged
Conversation
Hillary Mutisya (hillary-mutisya)
commented
Aug 12, 2026
Collaborator
- add cancellation, structured failures, bounded repair, and flow reuse
- register and implement all PowerShell namespaces
- require confirmation for mutating actions with unattended default-deny
- extract namespace actions into typed handlers with a shared registry
- add routing, persistence, concurrency, sandbox, and runtime coverage
- update Copilot dev-action routing and project documentation
- add cancellation, structured failures, bounded repair, and flow reuse - register and implement all PowerShell namespaces - require confirmation for mutating actions with unattended default-deny - extract namespace actions into typed handlers with a shared registry - add routing, persistence, concurrency, sandbox, and runtime coverage - update Copilot dev-action routing and project documentation
Copilot started reviewing on behalf of
Hillary Mutisya (hillary-mutisya)
August 12, 2026 00:08
View session
Hillary Mutisya (hillary-mutisya)
requested review from
George Ng (GeorgeNgMsft) and
jebrans
August 12, 2026 00:08
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the TypeAgent PowerShell dev-action and agent surface to support cancellable, structured, policy-aware execution, with a typed registry of namespace handlers and additional routing/persistence/concurrency/sandbox coverage.
Changes:
- Add structured PowerShell failure metadata (errorCode/retryable/mayHaveSideEffects) and bounded “repair once” flow repair support.
- Introduce typed PowerShell namespace action handlers (files/data/archives/processes/services/system/network) with a shared registry, plus manifest/schema/grammar updates.
- Update Copilot dev-actions hook routing for Windows-only recording, client request IDs, abort-driven cancellation, and longer hook timeout.
Show a summary per file
| File | Description |
|---|---|
| ts/packages/dispatcher/dispatcher/src/reasoning/reasoningProfile.ts | Updates PowerShell capability guidance to include bounded repair semantics. |
| ts/packages/copilot-plugin/test/hookDevActions.spec.ts | Extends hook tests for Windows-only behavior, abort cancellation, and unattended denial defaults. |
| ts/packages/copilot-plugin/src/shared/typeagent-client.ts | Adjusts ClientIO interaction behavior to default-deny unattended prompts. |
| ts/packages/copilot-plugin/src/hooks/hook-router.ts | Adds SIGINT/SIGTERM abort wiring and passes AbortSignal into dev-actions hook. |
| ts/packages/copilot-plugin/src/hooks/hook-dev-actions.ts | Adds Windows gating, clientRequestId submission, and abort-driven cancellation handling. |
| ts/packages/copilot-plugin/hooks.json | Increases hook timeout to accommodate longer-running dev actions. |
| ts/packages/agentSdk/src/action.ts | Extends ActionResultError with machine-readable errorCode and retry/side-effect metadata. |
| ts/packages/agents/powershell/test/powerShellStore.spec.ts | Validates the new repairAndExecutePowerShellFlow action appears in the schema. |
| ts/packages/agents/powershell/test/actionHandler.spec.ts | Adds namespace registration/execution coverage, confirmation policy tests, cancellation, concurrency, and sandbox/path policy tests. |
| ts/packages/agents/powershell/src/types/powerShellFailure.mts | Introduces structured PowerShell failure creation and execution failure classification. |
| ts/packages/agents/powershell/src/types/powerShellAgentContext.mts | Extracts a typed PowerShellAgentContext interface. |
| ts/packages/agents/powershell/src/store/powerShellStore.mts | Adds RepairAndExecutePowerShellFlow to generated schema/type union list. |
| ts/packages/agents/powershell/src/schema/scriptActions.mts | Adds RepairAndExecutePowerShellFlow type to the PowerShell action schema. |
| ts/packages/agents/powershell/src/namespaces/system/actionHandler.mts | Adds static system namespace handler definitions. |
| ts/packages/agents/powershell/src/namespaces/services/actionHandler.mts | Adds static services namespace handler definitions (with confirmation prompts for mutations). |
| ts/packages/agents/powershell/src/namespaces/processes/actionHandler.mts | Adds static processes namespace handler definitions (with confirmation prompts for mutations). |
| ts/packages/agents/powershell/src/namespaces/network/actionHandler.mts | Adds static network namespace handler definitions. |
| ts/packages/agents/powershell/src/namespaces/namespaceActionHandler.mts | Adds shared handler implementation (sandboxing, confirmation, abort-aware execution). |
| ts/packages/agents/powershell/src/namespaces/files/filesSchema.agr | Refines file grammar patterns (read/show/display variants). |
| ts/packages/agents/powershell/src/namespaces/files/actionHandler.mts | Adds static file namespace handler definitions (with confirmation prompts for mutations). |
| ts/packages/agents/powershell/src/namespaces/data/dataSchema.agr | Refines data grammar patterns for JSON display/read behaviors. |
| ts/packages/agents/powershell/src/namespaces/data/actionHandler.mts | Adds static data namespace handler definitions (with confirmation prompts for mutations). |
| ts/packages/agents/powershell/src/namespaces/archives/actionHandler.mts | Adds static archives namespace handler definitions (with confirmation prompts for mutations). |
| ts/packages/agents/powershell/src/namespaces/actionHandlerRegistry.mts | Adds registry/execution routing for namespace handlers and registration introspection helpers. |
| ts/packages/agents/powershell/src/manifest.json | Registers PowerShell sub-action manifests for additional namespaces. |
| ts/packages/agents/powershell/src/execution/powershellRunner.mts | Adds AbortSignal support and explicit cancellation reporting in ScriptExecutionResult. |
| ts/packages/agents/powershell/src/actionHandler.mts | Refactors PowerShell action handling for namespace routing, flow reuse/locking, repair-once, and abort-aware execution. |
| ts/packages/agents/powershell/scripts/scriptHost.ps1 | Hardens allowed-path expansion and prefix checks to avoid sibling-path bypasses. |
| ts/packages/agents/powershell/benchmark/scenarios/dev-actions-routing.json | Updates routing scenario expectations to include namespace schema identifiers. |
Review details
Tip
Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Suppressed comments (3)
ts/packages/agentSdk/src/action.ts:48
- Repo convention (ts/CLAUDE.md) asks to avoid em-dashes (—) in comments. Replace the em-dash in this comment with a hyphen to match the style used elsewhere in the file.
// Rich display to show in place of the plain `error` text (e.g. setup
// instructions with a config snippet, which need markdown to survive
// rendering). Optional — clients fall back to `error` when absent.
errorDisplayContent?: DisplayContent | undefined;
ts/packages/agents/powershell/src/actionHandler.mts:1056
- This overrides
fallbackToReasoningtotruefor all failures, includingpowershell.policyDenied,powershell.cancelled, andpowershell.partialSideEffects. That defeats the structured failure classification fromcreatePowerShellExecutionFailureand can cause the reasoning loop to treat denied/cancelled actions as retryable.
This issue also appears on line 1196 of the same file.
if (result.error !== undefined) {
return { ...result, fallbackToReasoning: true };
}
ts/packages/agents/powershell/src/actionHandler.mts:1198
- Same as above: forcing
fallbackToReasoning: trueon any error maskspolicyDenied/cancelled/partialSideEffectsfailures that should not fall back to reasoning or auto-repair.
if (result.error !== undefined) {
return { ...result, fallbackToReasoning: true };
}
- Files reviewed: 29/29 changed files
- Comments generated: 3
- Review effort level: Lite
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
jebrans
reviewed
Aug 12, 2026
George Ng (GeorgeNgMsft)
requested changes
Aug 12, 2026
George Ng (GeorgeNgMsft)
left a comment
Contributor
There was a problem hiding this comment.
Left a few comments, I think two are optional, but the potential sandbox gap is worth addressing.
- Add an executable parameter role, resolve bare executable names through PowerShell command resolution, canonicalize the resolved file, and enforce `allowedPaths`. - Remove string-shape path inference and validate only parameters explicitly declared as paths. - Split execution, persistence, activation, and usage accounting into distinct failure boundaries. Return `partialSideEffects` when execution succeeded but core completion failed.
George Ng (GeorgeNgMsft)
approved these changes
Aug 13, 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.