Skip to content

feat: add abort execution button to playground#23

Closed
tomi wants to merge 2 commits into
mainfrom
tomi/playground-abort-execution
Closed

feat: add abort execution button to playground#23
tomi wants to merge 2 commits into
mainfrom
tomi/playground-abort-execution

Conversation

@tomi

@tomi tomi commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The "Run" button transforms into a red "Abort" button while a command is executing
  • Clicking Abort or pressing Ctrl+C now calls DELETE /sandboxes/{id}/executions/{exec_id} to kill the server-side process, instead of only aborting the HTTP fetch stream
  • Tracks the exec_id from the started event so the correct execution can be targeted for cancellation
Kapture.2026-05-08.at.16.52.38.mp4

Test plan

  • Run a long-running command (e.g. sleep 60) and verify the button changes to red "Abort"
  • Click Abort and verify the process is killed server-side (exit event shows killed: true)
  • Press Ctrl+C during execution and verify the same abort behavior
  • Verify the button reverts to "Run" after execution completes or is aborted
  • Verify normal command execution still works end-to-end

tomi added 2 commits May 8, 2026 16:46
The Run button transforms into a red Abort button during execution.
Clicking it (or pressing Ctrl+C) now calls DELETE /executions/{id}
to kill the server-side process, not just abort the HTTP stream.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="playground/src/app.js">

<violation number="1" location="playground/src/app.js:260">
P1: Abort can miss server-side kill when pressed before `started` arrives, because DELETE is skipped if `currentExecId` is still null.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread playground/src/app.js
currentAbortController.abort();
appendOutput('^C', 'error');

if (execId && sandboxId) {

@cubic-dev-ai cubic-dev-ai Bot May 8, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Abort can miss server-side kill when pressed before started arrives, because DELETE is skipped if currentExecId is still null.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At playground/src/app.js, line 260:

<comment>Abort can miss server-side kill when pressed before `started` arrives, because DELETE is skipped if `currentExecId` is still null.</comment>

<file context>
@@ -247,19 +248,58 @@ async function execInSandbox(sandboxId, command, timeoutMs = 300000, signal) {
+  currentAbortController.abort();
+  appendOutput('^C', 'error');
+
+  if (execId && sandboxId) {
+    const baseUrl = baseUrlInput.value.trim().replace(/\/+$/, '');
+    try {
</file context>
Fix with Cubic

Base automatically changed from tomi/rename-exec-to-executions to main May 11, 2026 11:23
@tomi tomi closed this Jun 15, 2026
@tomi tomi deleted the tomi/playground-abort-execution branch June 15, 2026 06:11
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