KEMBAR78
Add command to re-run all running tasks by Copilot · Pull Request #252212 · microsoft/vscode · GitHub
Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 23, 2025

Implements a new command that allows users to restart all currently running tasks with a single action, addressing the need for a generic way to re-run multiple tasks simultaneously.

Changes

New Command Implementation:

  • Added RerunAllRunningTasksCommandId constant in tasks.ts
  • Implemented _runRerunAllRunningTasksCommand() method in abstractTaskService.ts
  • Registered command handler with proper trust checking and error handling

User Interface Integration:

  • Added "Rerun All Running Tasks" to Command Palette under Tasks category
  • Added "Rerun All Running Tasks..." to Terminal menu bar
  • Commands only appear when TASK_RUNNING_STATE is active (tasks are running)

User Experience Features:

  • Shows informative message when no tasks are running
  • Provides completion feedback indicating how many tasks were restarted
  • Uses Promise.allSettled() to restart all tasks concurrently without failing if individual tasks encounter errors
  • Leverages existing _restart() method for consistent task restart behavior

Usage

Users can now:

  1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Type "Rerun All Running Tasks"
  3. Execute the command to restart all currently running tasks

Or access it through Terminal → Rerun All Running Tasks... when tasks are active.

This provides a much more efficient workflow for development scenarios where multiple tasks need to be restarted simultaneously, such as when switching branches or updating configuration files.

Fixes #249956.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits June 23, 2025 18:36
Co-authored-by: anthonykim1 <62267334+anthonykim1@users.noreply.github.com>
Co-authored-by: anthonykim1 <62267334+anthonykim1@users.noreply.github.com>
Copilot AI changed the title [WIP] Provide a command to re-run all running tasks Add command to re-run all running tasks Jun 23, 2025
Copilot AI requested a review from anthonykim1 June 23, 2025 18:42
Copilot finished work on behalf of anthonykim1 June 23, 2025 18:42
@anthonykim1
Copy link
Contributor

@anthonykim1 anthonykim1 requested a review from meganrogge June 24, 2025 16:11
@anthonykim1 anthonykim1 marked this pull request as ready for review June 24, 2025 16:11
@vs-code-engineering vs-code-engineering bot added this to the June 2025 milestone Jun 24, 2025
@anthonykim1 anthonykim1 added the feature-request Request for new features or functionality label Jun 24, 2025
@meganrogge
Copy link
Contributor

Also, we should test with running more than one task - that compound task is really just 1 😄

Copilot AI and others added 2 commits June 24, 2025 17:58
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot finished work on behalf of meganrogge June 24, 2025 17:59
Copilot AI requested a review from meganrogge June 24, 2025 17:59
Copy link
Contributor Author

Copilot AI commented Jun 24, 2025

Also, we should test with running more than one task - that compound task is really just 1 😄

You're absolutely right! The implementation handles multiple independent tasks correctly - getActiveTasks() returns all running tasks (compound tasks appear as 1 task). The command uses Promise.allSettled() to restart all tasks concurrently and shows the count of restarted tasks. Testing with multiple independent tasks running simultaneously would be ideal to verify the functionality works as expected.

Copilot finished work on behalf of anthonykim1 June 24, 2025 18:48
@anthonykim1 anthonykim1 marked this pull request as draft June 24, 2025 18:48
@anthonykim1
Copy link
Contributor

anthonykim1 commented Jun 24, 2025

@meganrogge Yeap for sure!

I see from the UI that they are connected with the line before tool icon, but is there way to programmatically identify that some task is part of the single "compound" task?
I'm wondering if the property

	/**
	 * The other tasks this task depends on.
	 */
	dependsOn?: ITaskDependency[];

is the giveaway.

Attaching updated testing gif here:

Screen.Recording.2025-06-24.at.11.56.17.AM.mov

Note for copilot: Please do not try to add unnecessary notification dialog.

@anthonykim1 anthonykim1 marked this pull request as ready for review June 24, 2025 19:02
@anthonykim1 anthonykim1 enabled auto-merge (squash) June 24, 2025 20:11
@anthonykim1 anthonykim1 merged commit 73d2f24 into main Jun 24, 2025
8 checks passed
@anthonykim1 anthonykim1 deleted the copilot/fix-249956 branch June 24, 2025 20:12
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Aug 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature-request Request for new features or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a command to re-run all running tasks

3 participants