Skip to content

fix: task provider counter bug - #339387

Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
microsoft:mainfrom
SimonSiefke:fix/task-provider-completion
Nov 5, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 3 commits into
microsoft:mainfrom
SimonSiefke:fix/task-provider-completion

Conversation

@SimonSiefke

@SimonSiefke Simon Siefke (SimonSiefke) commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

This PR is related to for #338231.


In task provider, there is some logic to check how many tasks are pending.

The count gets increases when a new task list is being queried and decreased when the task list query finishes.

When the task list query takes longer than 5 seconds, its marked as timed out and the count decreases also.

This creates is a bug / edge case where when the task list query resolves after for example 6 seconds, the count accidentally decreases twice (once by timeout and once by the task list query resolving).

The pr changes and moves the counting logic slightly to make a late task list query resolve decrease the count by only once.


AI disclosure: Model: GPT 6.1 Sol. Worktime: 6 min

Copilot AI balanced review requested due to automatic review settings October 2, 2026 20:44
@SimonSiefke Simon Siefke (SimonSiefke) changed the title fix: task provider counting bug fix: task provider counter bug Oct 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused fix correctly addresses the race and includes effective regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes task-provider accounting when a provider settles after timing out.

Changes:

  • Tracks completion independently for each provider to prevent double decrements.
  • Adds regression coverage for late resolution and rejection.
File Description
abstractTaskService.ts Guards each provider’s completion accounting.
abstractTaskService.test.ts Tests both late settlement paths.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The test’s Object.create setup bypasses service initialization and private-member type checking, risking stale setup and runtime failures after refactors.

1 open issue

Review effort: Max

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Simon Siefke (@SimonSiefke) Thank you!

auto-merge was automatically disabled November 5, 2026 19:25

Pull request was closed

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit ac46c7e into microsoft:main Nov 5, 2026
114 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 5, 2026
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/task-provider-completion branch November 11, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tasks Task system issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants