Skip to content

t1276: Subtask-aware queue analysis, fix auto-pickup head-50 limit, orphan issue intake#2026

Merged
marcusquinn merged 1 commit intomainfrom
feature/t1276-subtask-queue-awareness
Feb 20, 2026
Merged

t1276: Subtask-aware queue analysis, fix auto-pickup head-50 limit, orphan issue intake#2026
marcusquinn merged 1 commit intomainfrom
feature/t1276-subtask-queue-awareness

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 20, 2026

Summary

  • Fix auto-pickup Strategy 4 head -50 limit — silently skipped subtask inheritance for parents beyond the 50th position. Only 2 of 242 #auto-dispatch parents have open subtasks, but both were beyond position 50. Now scans only open [ ] parents with no arbitrary limit.
  • Enhance runners-check — reports subtask-aware queue depth: total open (parents + subtasks), dispatchable (tagged + inherited), blocked, and claimed counts. Subtasks are the actual dispatchable work units.
  • Add TODO entries for 3 orphan user-reported GitHub issues: GH#1791 (setup.sh unbound variable), GH#1975 (skill discovery CLI), GH#1991 (wp-helper.sh CONFIG_FILE bug)
  • Re-add completed task entries for t1260, t1261, t1273 with pr: refs so issue-sync can close their stale open GitHub issues

Root Cause

cmd_auto_pickup() Strategy 4 collected parent IDs with head -50 | sort -u. With 242 #auto-dispatch parents in TODO.md (mostly completed), the open parents with subtasks (t1120, t1264) were beyond position 50 and never processed. Their subtasks (t1120.1, t1120.2, t1120.4, t1264.2) were invisible to the dispatcher despite the parent having #auto-dispatch.

Files Changed

  • .agents/scripts/supervisor/cron.sh — Remove head -50, filter to open parents only
  • .agents/scripts/commands/runners-check.md — Subtask-aware queue depth reporting
  • TODO.md — 3 new tasks (t1277-t1279), 3 restored completed tasks (t1260, t1261, t1273), t1276 entry

Closes #2024

Summary by CodeRabbit

  • New Features

    • Added subtask-aware queue analysis and monitoring to provide deeper insights into task status and metrics.
    • Introduced enhanced task tracking with inheritance awareness for dispatch decisions.
  • Bug Fixes

    • Improved task dispatch reliability and queue management logic.
    • Enhanced system self-healing capabilities for task processing.
  • Documentation

    • Updated monitoring dashboards with new queue analysis metrics and reporting formats.

…rphan issue intake

- Fix auto-pickup Strategy 4 head -50 limit that silently skipped subtask
  inheritance for parents beyond the 50th (only 2 of 242 parents have open
  subtasks, but they were beyond position 50). Now scans only open parents
  with no arbitrary limit.
- Enhance runners-check to report subtask-aware queue depth: total open
  items (parents + subtasks), dispatchable count (tagged + inherited from
  parent), blocked count, and claimed/in-progress count.
- Add TODO entries for 3 orphan user-reported GitHub issues: GH#1791
  (setup.sh unbound variable), GH#1975 (skill discovery CLI), GH#1991
  (wp-helper.sh CONFIG_FILE bug).
- Re-add completed task entries for t1260, t1261, t1273 with pr: refs
  so issue-sync can close their stale open GitHub issues.
@marcusquinn marcusquinn merged commit be8a802 into main Feb 20, 2026
6 of 7 checks passed
@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 significantly improves the task dispatching and monitoring capabilities of the system. It rectifies a critical bug that prevented subtasks from being processed due to an arbitrary limit, ensuring all relevant tasks are now considered for auto-dispatch. Additionally, it enhances visibility into the task queue by providing a more comprehensive, subtask-aware analysis, allowing for better understanding of work distribution and potential bottlenecks. The PR also incorporates several user-reported issues into the task tracking system and cleans up stale entries.

Highlights

  • Auto-pickup Limit Fix: Resolved an issue in cmd_auto_pickup() Strategy 4 by removing the head -50 limit, which previously caused subtask inheritance to be silently skipped for parents beyond the 50th position in TODO.md.
  • Subtask-aware Queue Analysis: Enhanced the runners-check script to provide detailed subtask-aware queue depth reporting, including total open tasks (parents + subtasks), dispatchable tasks (tagged + inherited), blocked, and claimed counts.
  • Orphan Issue Intake: Added new TODO entries for three user-reported GitHub issues (GH#1791, GH#1975, GH#1991) that were previously orphaned.
  • Completed Task Reconciliation: Re-added completed task entries for t1260, t1261, and t1273 with pr: references to facilitate closing their stale open GitHub issues via issue-sync.
Changelog
  • .agents/scripts/commands/runners-check.md
    • Introduced a new section for 'TODO.md queue analysis (subtask-aware)' with detailed metrics for total open, dispatchable, blocked, and claimed tasks.
    • Updated the numbering of subsequent sections (Open PRs, Active worktrees, System resources).
    • Added a 'Queue Depth (subtask-aware)' dashboard section with explanations for each metric.
    • Added a new action item: 'Subtasks missing #auto-dispatch'.
  • .agents/scripts/supervisor/cron.sh
    • Removed the 'head -50' command from the parent_ids collection logic in cmd_auto_pickup().
    • Modified the grep pattern to specifically target '[ ]' (open) parent tasks instead of '[ xX-]' (any state).
  • TODO.md
    • Added new open tasks: t1277 (setup.sh unbound variable), t1278 (Interactive Skill Discovery CLI), t1279 (wp-helper.sh CONFIG_FILE bug).
    • Changed the status of t1260, t1261, and t1273 from implicitly removed/completed to explicitly completed with pr: references.
    • Added an entry for t1276 (this PR's task).
Activity
  • No human activity (comments, reviews, etc.) has been recorded on this pull request yet.
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 20, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

This PR introduces subtask-aware queue analysis to the supervisor dashboard and dispatch system. Changes include replacing the runners-check.md "Open PRs" section with a new queue depth analysis, refining cron.sh's parent task collection logic to only consider OPEN parents, and adding new task entries to TODO.md covering queue stalls, dispatch safety, and subtask governance enhancements.

Changes

Cohort / File(s) Summary
Dashboard & Queue Analysis
.agents/scripts/commands/runners-check.md
Replaces "Open PRs from workers" section with new "TODO.md queue analysis (subtask-aware)" that parses subtasks, computes dispatchable queue metrics, tracks blocked/claimed states, and adds inheritance logic for #auto-dispatch flags. Introduces Queue Depth dashboard subsection and new action item #6 for dispatch gap detection.
Subtask Inheritance Logic
.agents/scripts/supervisor/cron.sh
Restricts parent task ID collection in Strategy 4 from all states to OPEN parents only (regex: - [ ]). Removes silent head -50 limit and adds clarifying comments linking behavior to task t1276.
Task Queue Expansion
TODO.md
Adds nine new tasks (t1260–t1279) focusing on supervisor self-healing, dispatch safety, subtask governance, macOS setup fixes, and interactive skills CLI, with cross-references to broader reliability and queue stall remediation initiatives.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🔄 Subtasks now dance in queues aware,
Parents open, dispatches fair,
Orphans caught in queue's deep stare,
Inheritance flows without a care,
Self-healing circuits light the air!

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/t1276-subtask-queue-awareness

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, 30 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 20 19:34:28 UTC 2026: Code review monitoring started
Fri Feb 20 19:34:28 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 30

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 30
  • VULNERABILITIES: 0

Generated on: Fri Feb 20 19:34:31 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

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 improves the auto-pickup logic by removing the arbitrary head -50 limit and refining the parent task selection to only include open tasks. It also enhances the runners-check command with subtask-aware queue depth reporting, providing a more accurate view of dispatchable work units. I have provided feedback on optimizing the queue analysis logic for better performance and ensuring consistency between the reporting and pickup logic, along with improvements regarding error suppression, adhering to the repository's guidelines on 2>/dev/null usage.

# Count ALL open items including subtasks — subtasks are the actual dispatchable units
TODO_FILE="$(git rev-parse --show-toplevel 2>/dev/null)/TODO.md"
if [[ -f "$TODO_FILE" ]]; then
total_open=$(grep -c '^[[:space:]]*- \[ \]' "$TODO_FILE" 2>/dev/null || echo 0)

Choose a reason for hiding this comment

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

medium

Avoid using 2>/dev/null for blanket suppression of errors on file operations when the file's existence has already been verified (as done on line 22). This practice is redundant for 'file not found' errors and can mask other important issues like permissions problems. This applies to multiple grep calls in this file (lines 23, 24, 27, 47, 49, 50).

References
  1. 2>/dev/null is acceptable ONLY when redirecting to log files, not blanket suppression. (link)
  2. Avoid using 2>/dev/null to suppress errors on file operations if the file's existence has already been verified by a preceding check (e.g., [[ -f "$file" ]] or an early return). This practice is redundant for 'file not found' errors and can mask other important issues like permissions problems.

Comment on lines +33 to +47
inherited=0
while IFS= read -r line; do
task_id=$(echo "$line" | grep -oE 't[0-9]+\.[0-9]+' | head -1)
if [[ -n "$task_id" ]]; then
parent_id=$(echo "$task_id" | sed 's/\.[0-9]*$//')
if grep -qE "^- \[.\] ${parent_id} .*#auto-dispatch" "$TODO_FILE" 2>/dev/null; then
# Check not blocked or claimed
if ! echo "$line" | grep -qE 'assignee:|started:'; then
if ! echo "$line" | grep -qE 'blocked-by:'; then
inherited=$((inherited + 1))
fi
fi
fi
fi
done < <(grep -E '^[[:space:]]+- \[ \] t[0-9]+\.[0-9]+' "$TODO_FILE" 2>/dev/null | grep -v '#auto-dispatch')

Choose a reason for hiding this comment

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

medium

The while loop with nested grep calls is inefficient, especially as TODO.md grows. It performs an O(N*M) operation where N is the number of subtasks and M is the number of lines in the file. This can be optimized to a single pass by pre-calculating the list of auto-dispatch parents. Additionally, the parent check should use [ ] instead of [.] to be consistent with the updated logic in cron.sh, which now only considers open parents for subtask inheritance.

Suggested change
inherited=0
while IFS= read -r line; do
task_id=$(echo "$line" | grep -oE 't[0-9]+\.[0-9]+' | head -1)
if [[ -n "$task_id" ]]; then
parent_id=$(echo "$task_id" | sed 's/\.[0-9]*$//')
if grep -qE "^- \[.\] ${parent_id} .*#auto-dispatch" "$TODO_FILE" 2>/dev/null; then
# Check not blocked or claimed
if ! echo "$line" | grep -qE 'assignee:|started:'; then
if ! echo "$line" | grep -qE 'blocked-by:'; then
inherited=$((inherited + 1))
fi
fi
fi
fi
done < <(grep -E '^[[:space:]]+- \[ \] t[0-9]+\.[0-9]+' "$TODO_FILE" 2>/dev/null | grep -v '#auto-dispatch')
# Subtasks whose parent has #auto-dispatch (inherited dispatchability)
auto_parents=$(grep -E '^- \[ \] t[0-9]+ .*#auto-dispatch' "$TODO_FILE" | grep -oE 't[0-9]+' | sort -u)
inherited=0
if [[ -n "$auto_parents" ]]; then
parent_pattern="^($(echo "$auto_parents" | tr '\n' '|' | sed 's/|$//'))$"
inherited=$(grep -E '^[[:space:]]+- \[ \] t[0-9]+\.[0-9]+' "$TODO_FILE" | \
grep -v '#auto-dispatch' | \
grep -vE 'assignee:|started:|blocked-by:' | \
sed -E 's/^[[:space:]]*- \[ \] (t[0-9]+).*/\1/' | \
grep -Ec "$parent_pattern" || echo 0)
fi

Comment on lines +750 to +751
parent_ids=$(grep -E '^[[:space:]]*- \[ \] (t[0-9]+) .*#auto-dispatch' "$todo_file" 2>/dev/null |
grep -oE 't[0-9]+' | sort -u || true)

Choose a reason for hiding this comment

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

medium

The grep pattern ^[[:space:]]*- [ ] matches indented subtasks. If a subtask has #auto-dispatch, grep -oE 't[0-9]+' will extract the root parent ID, causing Strategy 4 to pick up all its siblings even if the parent itself is not tagged. To strictly implement 'Subtasks whose parent has #auto-dispatch', the grep should be restricted to top-level tasks. Also, remove the redundant 2>/dev/null since the file existence is verified at line 722.

Suggested change
parent_ids=$(grep -E '^[[:space:]]*- \[ \] (t[0-9]+) .*#auto-dispatch' "$todo_file" 2>/dev/null |
grep -oE 't[0-9]+' | sort -u || true)
parent_ids=$(grep -E '^- \[ \] (t[0-9]+) .*#auto-dispatch' "$todo_file" |
grep -oE 't[0-9]+' | sort -u || true)
References
  1. Avoid using 2>/dev/null to suppress errors on file operations if the file's existence has already been verified by a preceding check. (link)
  2. Avoid using 2>/dev/null to suppress errors on file operations if the file's existence has already been verified by a preceding check (e.g., [[ -f "$file" ]] or an early return). This practice is redundant for 'file not found' errors and can mask other important issues like permissions problems.

@marcusquinn marcusquinn deleted the feature/t1276-subtask-queue-awareness branch February 21, 2026 01:59
marcusquinn added a commit that referenced this pull request Feb 21, 2026
- Strategy 4 head -50 fix verified in cron.sh (no head limit, open parents only)
- runners-check subtask-aware queue depth verified in runners-check.md
- 3 orphan TODO entries (t1277-t1279) confirmed in TODO.md
- 3 stale GH issues (GH#1970, #1973, #2014) confirmed CLOSED

Closes #2024
marcusquinn added a commit that referenced this pull request Feb 21, 2026
#2055)

- Strategy 4 head -50 fix verified in cron.sh (no head limit, open parents only)
- runners-check subtask-aware queue depth verified in runners-check.md
- 3 orphan TODO entries (t1277-t1279) confirmed in TODO.md
- 3 stale GH issues (GH#1970, #1973, #2014) confirmed CLOSED

Closes #2024
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.

t1276: Subtask-aware queue analysis and orphan issue intake

1 participant