Skip to content

Guard debug launch in constrained runspaces#2295

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/improve-constrained-runspace-debug
Draft

Guard debug launch in constrained runspaces#2295
Copilot wants to merge 2 commits into
mainfrom
copilot/improve-constrained-runspace-debug

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 3, 2026

PowerShell debug launch can silently degrade in constrained language mode when the runspace lacks the DAP commands PSES depends on. That leaves breakpoints skipped and the session misleadingly “running.”

  • Preflight constrained runspaces

    • Detect constrained language mode before launching a debug session.
    • Verify the required debug commands are available in the current runspace.
    • Abort launch early with a clear error when they are missing.
  • Fail fast with actionable feedback

    • Surface the requested message explaining that debugging cannot start until the administrator adds the missing debug commands to the constrained runspace.
    • Prevents the debugger from starting in a broken state.
  • Coverage

    • Added a focused test for constrained-language launch failure.
# When constrained mode is missing the debug commands, launch now stops immediately:
Cannot start debugging because you are running PowerShell in a constrained language mode that does not have the required debug commands available.
Please contact your administrator to add the debug commands to your constrained runspace.

Copilot AI changed the title [WIP] Improve debug experience in constrained runspace Guard debug launch in constrained runspaces Jun 3, 2026
Copilot AI requested a review from JustinGrote June 3, 2026 12:59
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.

Improve Constrained Runspace Debug Experience

2 participants