Repository navigation
fix: task system readiness races - #342418
Merged
Megan Rogge (meganrogge) merged 4 commits intoOct 30, 2026
Merged
Megan Rogge (meganrogge) merged 4 commits into
Megan Rogge (meganrogge) merged 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new test fixtures leave global command handlers registered against disposed services, compromising test isolation.
1 open issue
What changed in this PR
Fixes task-system readiness races that can occur when registrations are removed, supporting the linked extension-host cleanup change.
Changes:
- Filters readiness notifications and ties listeners to owner disposal.
- Rechecks readiness and disposal before automatic-task discovery.
- Adds regression coverage for local, remote, and disposal scenarios.
| File | Description |
|---|---|
| src/vs/workbench/contrib/tasks/test/browser/taskSystemReadiness.test.ts | Adds readiness and disposal regression tests. |
| src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts | Guards automatic-task startup while waiting. |
| src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts | Filters readiness events and owns listener cleanup. |
Review effort: Balanced
Megan Rogge (meganrogge)
enabled auto-merge
October 30, 2026 16:24
Megan Rogge (meganrogge)
approved these changes
Oct 30, 2026
Megan Rogge (meganrogge)
left a comment
Collaborator
There was a problem hiding this comment.
Thank you!
Federico Brancasi (federicobrancasi)
approved these changes
Oct 30, 2026
Ulugbek Abdullaev (ulugbekna)
approved these changes
Oct 30, 2026
Simon Siefke (SimonSiefke)
deleted the
fix/task-system-readiness-races
branch
October 30, 2026 22:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR is needed for #331198
Details
A task-system change notification can arrive before the required task systems are ready. Readiness can also change before an awaiting callback resumes, or the automatic-task contribution can be disposed while it waits. These cases can start task discovery too early or after disposal.
Change
Wait for notifications that satisfy
hasTaskSystemInfo, recheck readiness after each wait, and dispose pending listeners with their owner. Stop automatic-task startup when the contribution has been disposed.Before
Four readiness regression tests fail on the base branch: a removal notification resolves readiness too early, automatic tasks start before remote readiness, and pending startup work continues or leaves a listener after disposal.
After
All five readiness tests pass, including local startup, changes before remote readiness, and disposal before or immediately after readiness.
Test Video
test-video.webm
AI disclosure: Model: GPT-6.1 Sol. Worktime: 13 min