Skip to content

fix(learn): ignore parallel tool call cancellations#3024

Open
houtinghang wants to merge 1 commit into
rtk-ai:developfrom
houtinghang:fix/learn-ignore-parallel-cancellations
Open

fix(learn): ignore parallel tool call cancellations#3024
houtinghang wants to merge 1 commit into
rtk-ai:developfrom
houtinghang:fix/learn-ignore-parallel-cancellations

Conversation

@houtinghang

Copy link
Copy Markdown

Summary

  • Ignore Claude Code parallel tool-call cancellations during rtk learn error classification.
  • Add a regression test based on the reported cancellation payload to ensure sibling parallel commands are not emitted as CLI corrections.

Root cause

is_command_error filtered explicit user-rejection phrases, but did not recognize:

<tool_use_error>Cancelled: parallel tool call Bash(...) errored</tool_use_error>

Because the payload contains errored, it passed the generic error-content check. find_corrections then treated the next sibling command as a successful replacement and generated a false Use X not Y rule.

Impact

Cancelled parallel work is now excluded before correction pairing, preventing false rules from dominating generated cli-corrections.md files.

Fixes #1659.

Validation

  • cargo test learn::detector::tests:: -- --nocapture — 16 passed.
  • cargo fmt --all --check — passed.
  • cargo clippy --all-targets — passed.
  • Full local Windows run: 2,404 passed; 30 existing environment-dependent tests failed because the sandbox blocks %APPDATA% writes or expects Unix commands. No learn tests failed.

@CLAassistant

CLAassistant commented Jul 16, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@houtinghang houtinghang marked this pull request as ready for review July 16, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rtk learn: parallel-tool-call cancellations misclassified as CLI errors, swamping output

2 participants