fix(learn): drop parallel-tool-call cancellations from corrections#1662
Open
season179 wants to merge 1 commit intortk-ai:developfrom
Open
fix(learn): drop parallel-tool-call cancellations from corrections#1662season179 wants to merge 1 commit intortk-ai:developfrom
season179 wants to merge 1 commit intortk-ai:developfrom
Conversation
`rtk learn` was treating Claude Code's parallel-tool-call cancellations (`<tool_use_error>Cancelled: parallel tool call ...`) as CLI errors, so when a user Ctrl-C'd one branch of a fan-out the next adjacent command got emitted as the "fix". On a 30-day window this dominates the output (reporter saw 5060 lines / 251 KB of mostly bogus rules). Filter cancellations at both sides of the correction-pair search: - `is_command_error` rejects them as the wrong-side - the inner-loop iterator filters them before `take(WINDOW)` so they don't consume lookahead slots and hide a valid fix after them Filter is gated on `is_error=true` so a successful command whose stdout merely echoes the phrase (build logs, etc.) stays eligible. Closes rtk-ai#1659.
Collaborator
📊 Automated PR Analysis
SummaryFilters out Claude Code's parallel-tool-call cancellation markers from the correction-pair detection in Review Checklist
Linked issues: #1659 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
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.
Closes #1659.
rtk learntreated Claude Code's parallel-tool-call cancellations as CLI errors, so the next adjacent command got emitted as the "fix" — dominating the output (reporter: 5060 lines / 251 KB on a 30-day window).Filter the cancellation marker at both sides of the correction-pair search:
is_command_errorrejects it as wrong-side; the inner-loop iterator filters beforetake(WINDOW)so cancellations don't consume lookahead slots and hide a real fix after them. Gated onis_error=trueso a successful command whose stdout merely mentions the phrase stays eligible.5 new unit tests cover the issue's repro plus edge cases (window-consumption, success-with-phrase, all-caps, mid-stream mention, leading whitespace).