Repository navigation
fix: task provider counter bug - #339387
Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits intoNov 5, 2026
Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
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.
Collaborator
|
Simon Siefke (@SimonSiefke) Thank you! |
Dmitriy Vasyura (dmitrivMS)
enabled auto-merge (squash)
November 5, 2026 07:54
Dmitriy Vasyura (dmitrivMS)
approved these changes
Nov 5, 2026
Dirk Bäumer (dbaeumer)
approved these changes
Nov 5, 2026
Giuseppe Cianci (Giuspepe)
approved these changes
Nov 5, 2026
auto-merge was automatically disabled
November 5, 2026 19:25
Pull request was closed
Dmitriy Vasyura (dmitrivMS)
enabled auto-merge (squash)
November 5, 2026 19:25
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 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