Skip to content

Add PowerShell cancellation and stop controls - #51

Closed
eosfor wants to merge 4 commits into
DataficationSDK:mainfrom
eosfor:pr/powershell-cancellation-stop
Closed

eosfor wants to merge 4 commits into
DataficationSDK:mainfrom
eosfor:pr/powershell-cancellation-stop

Conversation

@eosfor

@eosfor eosfor commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem

PowerShell execution could be long-running, but the UI did not have a reliable way to stop an in-flight execution. Cancellation also needed to bypass the host's sequential request queue, otherwise a cancel request could wait behind the execution it is trying to interrupt.

Approach

Add notebook-level cancellation APIs and route execution/cancel immediately in the host input loop. The Blazor UI can then show stop controls while PowerShell cells are running and send cancellation without waiting for the normal queued request path.

Notable changes

  • Handle execution/cancel outside the host's sequential request queue.
  • Add cancellation methods to the notebook service surface for server and WASM front ends.
  • Wire WASM cancellation through the VS Code bridge/host protocol.
  • Show stop controls for running PowerShell cells in notebook and dashboard views.
  • Keep the kernel usable after a cancelled execution.
  • Add PowerShell cancellation coverage.

Validation

  • dotnet test tests/Verso.PowerShell.Tests/Verso.PowerShell.Tests.csproj --no-restore
  • dotnet build Verso.sln --no-restore

Manual check

Start a long-running PowerShell cell, then press the stop control:

Start-Sleep -Seconds 30
"after"

The cell should stop without waiting for the sleep to finish, and a later PowerShell cell should still execute successfully.

Review notes

This PR depends conceptually on the PowerShell execution path but is separated from host UI streaming/input so cancellation can be reviewed independently.

@TorreyBetts

Copy link
Copy Markdown
Contributor

Thanks for taking the time to put this PR together and submitting it. Your approach was good, however it only covered PowerShell. We're closing this in favor of a generalized implementation that will be available in source and as part of the next release. Really appreciate the contribution.

@TorreyBetts TorreyBetts closed this May 6, 2026
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