-
Notifications
You must be signed in to change notification settings - Fork 39
t1276: Subtask-aware queue analysis, fix auto-pickup head-50 limit, orphan issue intake #2026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,14 +16,53 @@ Run these commands in parallel and present a unified report: | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 1. Active batch status | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ~/.aidevops/agents/scripts/supervisor-helper.sh status 2>&1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 2. Open PRs from workers (need merge/review) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 2. TODO.md queue analysis (subtask-aware) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 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) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| parent_open=$(grep -c '^- \[ \]' "$TODO_FILE" 2>/dev/null || echo 0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| subtask_open=$((total_open - parent_open)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Dispatchable: open, has #auto-dispatch (or parent does), not blocked, not claimed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dispatchable=$(grep -E '^[[:space:]]*- \[ \] t[0-9]+' "$TODO_FILE" 2>/dev/null | \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| grep -v 'assignee:\|started:' | \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| grep -v 'blocked-by:' | \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| grep -c '#auto-dispatch' 2>/dev/null || echo 0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Subtasks whose parent has #auto-dispatch (inherited dispatchability) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # For each open subtask, check if its parent line has #auto-dispatch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+33
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| total_dispatchable=$((dispatchable + inherited)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| blocked=$(grep -E '^[[:space:]]*- \[ \]' "$TODO_FILE" 2>/dev/null | grep -c 'blocked-by:' || echo 0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| claimed=$(grep -E '^[[:space:]]*- \[ \]' "$TODO_FILE" 2>/dev/null | grep -cE 'assignee:|started:' || echo 0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "=== TODO.md Queue ===" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Total open: $total_open ($parent_open parents, $subtask_open subtasks)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Dispatchable: $total_dispatchable (tagged: $dispatchable, inherited: $inherited)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Blocked: $blocked" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Claimed/in-progress: $claimed" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 3. Open PRs from workers (need merge/review) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gh pr list --state open --json number,title,headRefName,createdAt,statusCheckRollup \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --jq '.[] | "\(.number) [\(.headRefName)] \(.title) checks:\(.statusCheckRollup | map(.conclusion // .state) | join(","))"' 2>/dev/null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 3. Active worktrees (worker sessions) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 4. Active worktrees (worker sessions) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git worktree list 2>/dev/null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 4. System resources | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # 5. System resources | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ~/.aidevops/agents/scripts/supervisor-helper.sh db \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "SELECT id, state, retries FROM tasks WHERE state NOT IN ('deployed','cancelled','failed') ORDER BY state;" 2>/dev/null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -32,6 +71,14 @@ git worktree list 2>/dev/null | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Present results as a concise dashboard: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### Queue Depth (subtask-aware) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **Total open**: X (Y parents, Z subtasks) — subtasks are the actual work units | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **Dispatchable now**: N (M tagged #auto-dispatch, K inherited from parent) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **Blocked**: B (waiting on dependencies) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **Claimed/in-progress**: C (assigned to workers or interactive sessions) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Flag if dispatchable count is 0 but open count is high (queue stall) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### Batch Status | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Batch name, total/completed/queued/running/failed counts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -40,11 +87,13 @@ Present results as a concise dashboard: | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### Action Items | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Flag these for the user (most important first): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1. **PRs ready to merge** — all CI green, no review comments | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2. **PRs with CI failures** — need investigation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3. **Tasks stuck** — in retrying/evaluating too long | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4. **Tasks at max retries** — need manual intervention or re-queue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5. **Stale worktrees** — for tasks already deployed/merged | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6. **Subtasks missing #auto-dispatch** — parent has tag but subtasks don't (dispatch gap) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### System Health | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -743,10 +743,12 @@ cmd_auto_pickup() { | |||||||||
| # from parent when the subtask has no explicit model: field. | ||||||||||
| # This unblocks subtask trees like t1081.1-t1081.4 and t1082.1-t1082.4. | ||||||||||
|
|
||||||||||
| # Step 1: Collect parent task IDs that have #auto-dispatch | ||||||||||
| # Step 1: Collect OPEN parent task IDs that have #auto-dispatch (t1276) | ||||||||||
| # Only open parents ([ ]) — completed parents' subtasks are irrelevant. | ||||||||||
| # Previous head -50 limit caused parents beyond the 50th to be silently skipped. | ||||||||||
| local parent_ids | ||||||||||
| parent_ids=$(grep -E '^[[:space:]]*- \[[ xX-]\] (t[0-9]+) .*#auto-dispatch' "$todo_file" 2>/dev/null | | ||||||||||
| grep -oE 't[0-9]+' | head -50 | sort -u || true) | ||||||||||
| parent_ids=$(grep -E '^[[:space:]]*- \[ \] (t[0-9]+) .*#auto-dispatch' "$todo_file" 2>/dev/null | | ||||||||||
| grep -oE 't[0-9]+' | sort -u || true) | ||||||||||
|
Comment on lines
+750
to
+751
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
References
|
||||||||||
|
|
||||||||||
| if [[ -n "$parent_ids" ]]; then | ||||||||||
| while IFS= read -r parent_id; do | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using
2>/dev/nullfor 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 multiplegrepcalls in this file (lines 23, 24, 27, 47, 49, 50).References
2>/dev/nullto 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.