Skip to content

Comments

fix: pre-dispatch check matched [x] in task description, not checkbox (t290)#1132

Merged
marcusquinn merged 1 commit intomainfrom
bugfix/t290-predispatch-regex
Feb 11, 2026
Merged

fix: pre-dispatch check matched [x] in task description, not checkbox (t290)#1132
marcusquinn merged 1 commit intomainfrom
bugfix/t290-predispatch-regex

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 11, 2026

Summary

  • is_task_already_complete() used =~ \[x\] which matched [x] anywhere in the TODO.md line
  • Task descriptions containing literal [x] text (e.g., "catches [x] in TODO.md") were falsely detected as complete
  • Now extracts only the checkbox character from the line-start position using sed
  • This caused t290 itself to be un-dispatchable (its description mentions [x])

Task

t290

Ref #1124

Testing

  • bash -n: pass
  • shellcheck -S warning: no new warnings
  • Manual regex test: [ ] line with [x] in description correctly returns space, not x

Summary by CodeRabbit

  • Bug Fixes
    • Improved accuracy of task completion detection by refining how the system identifies completed tasks, eliminating false positives that could occur when task descriptions contained completion markers.

… (t290)

is_task_already_complete() used '=~ \[x\]' which matched [x] anywhere
in the line, including task descriptions that mention '[x]'. Now extracts
only the checkbox character from the line-start pattern using sed.
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 addresses a critical bug in the task completion detection logic. Previously, the system would misinterpret tasks as completed if their descriptions happened to contain the string [x], leading to incorrect pre-dispatch checks. The changes introduce a more precise method for identifying the actual checkbox status at the start of a task line, thereby ensuring the accuracy of task completion assessments and preventing tasks from being erroneously marked as done.

Highlights

  • Bug Fix: Resolved an issue where the is_task_already_complete() function incorrectly identified tasks as complete if their description contained the literal string [x].
  • Improved Checkbox Detection: Modified the task completion check to accurately extract only the checkbox character from the beginning of the line using sed, preventing false positives.
  • Impact: This fix ensures that tasks are only marked as complete when the checkbox itself is [x], not when [x] appears elsewhere in the task description.
Changelog
  • .agents/scripts/supervisor-helper.sh
    • Updated the check_task_already_done function to use sed for precise extraction of the checkbox character.
    • Replaced a broad regex match for [x] with a targeted check on the extracted checkbox character to prevent false positives.
Activity
  • The author performed bash -n for syntax checking.
  • The author performed shellcheck -S warning to ensure no new warnings were introduced.
  • The author conducted a manual regex test to confirm correct behavior for [ ] lines with [x] in the description.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Walkthrough

Refines task-completion detection in the supervisor helper script by improving TODO.md checkbox parsing. Instead of checking for any [x] in the matched line, the code now extracts and validates only the checkbox character at line start, eliminating false positives from task descriptions.

Changes

Cohort / File(s) Summary
Checkbox Parsing Refinement
.agents/scripts/supervisor-helper.sh
Improved TODO.md checkbox extraction to validate only the initial checkbox character, eliminating false positives from task descriptions containing checkbox-like patterns.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

✅ A checkbox stood at the start of the line,
No longer fooled by descriptions so fine,
Precision parsing keeps tasks on track,
Quality reinforced with each small hack.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing a pre-dispatch check that incorrectly matched [x] in task descriptions instead of just the checkbox character.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/t290-predispatch-regex

No actionable comments were generated in the recent review. 🎉


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 47 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Wed Feb 11 14:43:09 UTC 2026: Code review monitoring started
Wed Feb 11 14:43:10 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 47

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 47
  • VULNERABILITIES: 0

Generated on: Wed Feb 11 14:43:12 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

@marcusquinn marcusquinn merged commit 4ffb94c into main Feb 11, 2026
10 checks passed
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes a bug where the pre-dispatch check for completed tasks was matching [x] anywhere in the task description, leading to false positives. The use of sed to precisely extract the checkbox status is a robust solution. I've suggested a minor refactoring to use a bash-native regular expression, which is slightly more efficient and concise, but the current implementation is correct and effectively resolves the issue.

Comment on lines +3200 to +3203
# Extract ONLY the checkbox at the start of the line, not [x] anywhere in description
local checkbox=""
checkbox=$(printf '%s' "$first_match" | sed -n 's/^[[:space:]]*- \[\(.\)\].*/\1/p')
if [[ "$checkbox" == "x" ]]; then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This is a correct fix for the issue. For improved performance and conciseness, you could consider using a single bash regular expression match. This avoids spawning printf and sed subprocesses and is generally more efficient.

Suggested change
# Extract ONLY the checkbox at the start of the line, not [x] anywhere in description
local checkbox=""
checkbox=$(printf '%s' "$first_match" | sed -n 's/^[[:space:]]*- \[\(.\)\].*/\1/p')
if [[ "$checkbox" == "x" ]]; then
if [[ "$first_match" =~ ^[[:space:]]*-\ \[x\] ]]; then

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.

1 participant