fix: prevent pre-dispatch false positives from substring and non-completion matches#807
Conversation
…letion matches Three bugs fixed in check_task_already_done(): 1. Substring matching: t020 was matching t020.6 commits. Added word boundary pattern that prevents parent task IDs from matching subtask commits. 2. Non-completion commits: 'chore: add t194' matched because 'chore' was in the completion evidence pattern. Now requires PR merge reference (#NNN) and excludes add/claim/queue/blocked commits. 3. GitHub PR search: added quotes around task ID to prevent substring matches. Root cause: the pre-dispatch check (PR #806) was too aggressive, cancelling 4 tasks (t020.4-6, t194) that were NOT actually done.
Summary of ChangesHello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request provides a hotfix to address false positives in the pre-dispatch verification system, which were causing incorrect task cancellations. The changes focus on increasing the precision of task completion detection by refining how task IDs are matched in commit messages and GitHub PR titles, and by establishing stricter criteria for what constitutes a valid completion commit. This ensures that the system accurately identifies truly completed tasks, thereby preventing premature cancellations and improving overall task management reliability. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Caution Review failedThe pull request is closed. WalkthroughUpdated Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Mon Feb 9 20:42:47 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
There was a problem hiding this comment.
Code Review
This pull request introduces several important fixes to the pre-dispatch verification logic to prevent false positives. The changes correctly add boundary matching for task IDs in git logs and exact matching for GitHub PR searches. My review confirms the new regex patterns are robust. I've identified a couple of instances where an unescaped task ID is used in a regex, which could lead to incorrect behavior for subtasks. The proposed suggestions will fix these issues and also resolve a ShellCheck violation for an unused variable, in line with the repository's style guide.
| # grep -w uses word boundaries but dots aren't word chars, so for subtask IDs | ||
| # like t020.1 we need a custom boundary: task_id followed by non-digit or EOL. | ||
| # This prevents t020 from matching t020.1, t020.2, etc. | ||
| local boundary_pattern="${task_id}([^.0-9]|$)" |
There was a problem hiding this comment.
The boundary_pattern is constructed using the unescaped $task_id. If the task ID contains special regex characters (like a dot in t020.1), it will be misinterpreted by grep -E, leading to incorrect matches. The escaped_task_regex variable was correctly created for this purpose but is not used.
Using the escaped variable will fix the bug and also resolve a ShellCheck violation (SC2034), adhering to the repository's style guide.
| local boundary_pattern="${task_id}([^.0-9]|$)" | |
| local boundary_pattern="${escaped_task_regex}([^.0-9]|$)" |
References
- The repository style guide (line 14) requires zero ShellCheck violations. The unused
escaped_task_regexvariable would trigger a ShellCheck warning (SC2034). Using it as suggested resolves this violation. (link)
| | grep -iE "(feat|fix|refactor|chore|perf|test).*${task_id}|${task_id}.*(\(#[0-9]+\)|PR #[0-9]+|merged)" \ | ||
| | grep -E "$boundary_pattern" \ | ||
| | grep -iE "\(#[0-9]+\)|PR #[0-9]+ merged" \ | ||
| | grep -ivE "add ${task_id}|claim ${task_id}|mark ${task_id}|queue ${task_id}|blocked" \ |
There was a problem hiding this comment.
Similar to the issue with boundary_pattern, the unescaped $task_id is used in this grep pattern. If the task ID contains a dot, it will act as a wildcard, which could cause the filter to behave incorrectly. You should use the escaped_task_regex variable here for correct and safe matching.
| | grep -ivE "add ${task_id}|claim ${task_id}|mark ${task_id}|queue ${task_id}|blocked" \ | |
| | grep -ivE "add ${escaped_task_regex}|claim ${escaped_task_regex}|mark ${escaped_task_regex}|queue ${escaped_task_regex}|blocked" \ |



Summary
Hotfix for PR #806's pre-dispatch verification which was too aggressive, causing false cancellations.
Bugs fixed:
t020matchedt020.6commits. Added boundary patterntask_id([^.0-9]|$)to prevent parent IDs matching subtask commitschore: add t194matched becausechorewas in the evidence pattern. Now requires PR merge reference(#NNN)and excludes add/claim/queue/blocked commitsImpact: 4 tasks (t020.4, t020.5, t020.6, t194) were falsely cancelled. Will re-queue after merge.
Summary by CodeRabbit