fix: parallel tool call failure counter increments once per batch (EXT-728)#11184
Draft
roomote[bot] wants to merge 1 commit intomainfrom
Draft
fix: parallel tool call failure counter increments once per batch (EXT-728)#11184roomote[bot] wants to merge 1 commit intomainfrom
roomote[bot] wants to merge 1 commit intomainfrom
Conversation
…T-728) When parallel tool calls are executed and all of them fail, the failure counter should increment by 1, not by the number of failed tools. This prevents the "Roo is having trouble" error from appearing prematurely. Changes: - Add consecutiveMistakeCountAtBatchStart and parallelToolSuccessInBatch tracking fields to Task.ts - Add recordToolSuccess() helper method that marks batch success and resets the mistake counter - Initialize batch tracking at the start of each API request - Add batch reconciliation logic after all tools complete to adjust the mistake counter appropriately - Update all tool handlers to use recordToolSuccess() instead of directly setting consecutiveMistakeCount = 0 - Add comprehensive tests for the new behavior
Contributor
Author
Review completed. The implementation correctly fixes the parallel tool call failure counter issue. One minor suggestion for improving test clarity:
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| }) | ||
|
|
||
| describe("when at least one tool succeeds", () => { | ||
| it("should keep counter at 0 when 1 tool succeeds and 2 fail", () => { |
Contributor
Author
There was a problem hiding this comment.
The test name says "should keep counter at 0" but the actual assertion expects 1. The test behavior and comments are correct, but the name is misleading.
Suggested change
| it("should keep counter at 0 when 1 tool succeeds and 2 fail", () => { | |
| it("should not reconcile counter when at least one tool succeeds (even if failures follow)", () => { |
Fix it with Roo Code or mention @roomote and request a fix.
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.
When parallel tool calls are executed and all of them fail, the failure counter should increment by 1, not by the number of failed tools. This prevents the "Roo is having trouble" error from appearing prematurely.
Problem
When parallel tool calls are made (e.g., 3 tools in a single API response), each tool failure increments
consecutiveMistakeCountindependently. If all 3 tools fail, the counter goes up by 3 instead of 1, causing the mistake limit to be reached prematurely.Solution
Treat parallel tool calls as a batch for failure counting purposes:
Changes
consecutiveMistakeCountAtBatchStartandparallelToolSuccessInBatchtracking fields to Task.tsrecordToolSuccess()helper method that marks batch success and resets the mistake counterrecordToolSuccess()instead of directly settingconsecutiveMistakeCount = 0Expected Behavior
After the fix:
Linear issue: https://linear.app/roocode/issue/EXT-728/roo-is-having-trouble-on-parallel-tool-calls
View task on Roo Code Cloud
Important
Fixes parallel tool call failure counter to increment once per batch, with updates to
Task.tsand comprehensive tests added.consecutiveMistakeCountAtBatchStartandparallelToolSuccessInBatchfields toTask.ts.recordToolSuccess()method inTask.tsto mark batch success and reset the mistake counter.recordToolSuccess()instead of directly settingconsecutiveMistakeCount = 0.Task.ts.Task.tsto adjust the mistake counter after all tools complete.parallel-tool-failure-counter.spec.tswith comprehensive tests for the new behavior.This description was created by
for eb0dae6. You can customize this summary. It will automatically update as commits are pushed.