Skip to content

feat(automations): add stop task run action#2870

Open
janburzinski wants to merge 6 commits into
mainfrom
jan/eng-1860-add-stop-task-run-action-to-automation-overview
Open

feat(automations): add stop task run action#2870
janburzinski wants to merge 6 commits into
mainfrom
jan/eng-1860-add-stop-task-run-action-to-automation-overview

Conversation

@janburzinski

@janburzinski janburzinski commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds a hover action to stop automation task runs from the run overview. The action replaces the run status while hovered, shows explicit Stopping… and Stopped feedback, and handles both runs that are still launching and already-created tasks with active PTY or ACP conversations.

Stopping an in-progress launch now prevents later automation steps from overwriting the stopped state. Stopping an already-created task terminates its active conversation and resets the stale agent status to idle.

Related issues

ENG-1860

Screenshot/Recording (if applicable)

https://cap.link/3zxhrvk94f1ezfn

Checklist
  • I kept this PR small and focused
  • I ran a self-review before opening this PR
  • I ran the relevant local checks or explained why not
  • Docs are not required for this UI change
  • I added or updated tests for the changed behavior
  • I only added comments where the logic is not obvious
  • I used Conventional Commits for the commit message and PR title

@janburzinski
janburzinski marked this pull request as ready for review July 14, 2026 17:36
@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a stop action for automation task runs. The main changes are:

  • Stop controls in the automation run row UI.
  • Server-side stop handling for queued, launching, and active task runs.
  • Guarded automation run transitions to avoid stale status writes.
  • Cleanup paths for launched tasks, PTY sessions, ACP turns, and agent status.
  • Tests for stop races during task creation and final run completion.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/emdash-desktop/src/main/core/automations/actions/taskCreate.ts Adds manual-stop checks and cleanup around task launch, conversation creation, and ACP session startup.
apps/emdash-desktop/src/main/core/automations/automations-service.ts Adds task run stopping for queued, in-progress, and active completed runs.
apps/emdash-desktop/src/main/core/automations/run-transitions.ts Adds guarded status transitions for launch, conversation creation, completion, and manual stop.
apps/emdash-desktop/src/main/core/automations/runtime.ts Uses a guarded completion transition and preserves manually stopped run state.
apps/emdash-desktop/src/renderer/features/automations/use-automation-run-actions.ts Adds stop-run action state and stop eligibility checks for automation run rows.

Reviews (5): Last reviewed commit: "fix(automations): clean up stopped task ..." | Re-trigger Greptile

@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

Comment thread apps/emdash-desktop/src/main/core/automations/automations-service.ts Outdated
Comment thread apps/emdash-desktop/src/main/core/automations/runtime.ts Outdated
@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

Comment thread apps/emdash-desktop/src/main/core/automations/automations-service.ts Outdated
@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

Comment thread apps/emdash-desktop/src/main/core/automations/actions/taskCreate.ts Outdated
Comment thread apps/emdash-desktop/src/main/core/automations/actions/taskCreate.ts Outdated
@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

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.

1 participant