Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Use `/save-todo` after planning. Auto-detects complexity:

**Dependencies**: `blocked-by:t001`, `blocks:t002`, `t001.1` (subtask)

**Auto-dispatch**: Add `#auto-dispatch` to tasks that can run autonomously (clear spec, bounded scope, no user input needed). Default to including it — only omit when a specific exclusion applies. See `workflows/plans.md` "Auto-Dispatch Tagging" for full criteria. The supervisor's Phase 0 picks these up automatically every 2 minutes and auto-creates batches (`auto-YYYYMMDD-HHMMSS`, concurrency 3) when no active batch exists.
**Auto-dispatch**: Add `#auto-dispatch` to tasks that can run autonomously (clear spec, bounded scope, no user input needed). Default to including it — only omit when a specific exclusion applies. See `workflows/plans.md` "Auto-Dispatch Tagging" for full criteria. The supervisor's Phase 0 picks these up automatically every 2 minutes and auto-creates batches (`auto-YYYYMMDD-HHMMSS`, concurrency = cores/2, min 2) when no active batch exists.

**Task completion rules** (CRITICAL - prevents false completion cascade):
- NEVER mark a task `[x]` unless a merged PR exists with real deliverables for that task
Expand Down
20 changes: 16 additions & 4 deletions .agents/scripts/supervisor-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13079,13 +13079,22 @@ cmd_auto_pickup() {
log_success "Auto-batch: added $added_count tasks to active batch $active_batch_id"
fi
else
# Create a new auto-batch
# Create a new auto-batch with resource-aware concurrency
local auto_batch_name
auto_batch_name="auto-$(date +%Y%m%d-%H%M%S)"
local task_csv
task_csv=$(echo "$unbatched_queued" | tr '\n' ',' | sed 's/,$//')
# Derive base concurrency from CPU cores (cores / 2, min 2)
# A 10-core Mac gets 5, a 32-core server gets 16, etc.
# The adaptive scaling in calculate_adaptive_concurrency() then
# adjusts up/down from this base depending on actual load.
local auto_cores="$(get_cpu_cores)"

Choose a reason for hiding this comment

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

medium

For better readability and to follow the practice of declaring variables at the top of their scope, it's good to group local variable declarations. You can declare auto_batch_id here along with auto_cores and auto_base_concurrency and remove the separate declaration on line 13097.

Suggested change
local auto_cores="$(get_cpu_cores)"
local auto_cores auto_base_concurrency auto_batch_id

local auto_base_concurrency=$((auto_cores / 2))
if [[ "$auto_base_concurrency" -lt 2 ]]; then
auto_base_concurrency=2
fi
local auto_batch_id
auto_batch_id=$(cmd_batch "$auto_batch_name" --concurrency 3 --tasks "$task_csv" 2>/dev/null)
auto_batch_id=$(cmd_batch "$auto_batch_name" --concurrency "$auto_base_concurrency" --tasks "$task_csv" 2>/dev/null)

Choose a reason for hiding this comment

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

medium

Since auto_batch_id is now declared on line 13091 with the other local variables, this line is redundant and can be removed.

if [[ -n "$auto_batch_id" ]]; then
log_success "Auto-batch: created '$auto_batch_name' ($auto_batch_id) with $picked_up tasks"
fi
Expand Down Expand Up @@ -14264,10 +14273,13 @@ Cron Integration & Auto-Pickup (t128.5, t296):
2. Tasks listed under a "## Dispatch Queue" section header
Both strategies skip tasks already tracked by the supervisor.

Auto-batching (t296): When new tasks are picked up, they are automatically
Auto-batching (t296, t321): When new tasks are picked up, they are automatically
assigned to a batch. If an active batch exists, tasks are added to it.
Otherwise, a new batch named 'auto-YYYYMMDD-HHMMSS' is created with
concurrency 3. This ensures all auto-dispatched tasks get batch-level
base concurrency derived from CPU cores (cores / 2, min 2). A 10-core
machine gets base 5, a 32-core server gets 16, etc. The adaptive scaling
then adjusts up/down from this base depending on actual CPU load.
This ensures all auto-dispatched tasks get batch-level
concurrency control, completion tracking, and lifecycle management.

Cron scheduling runs pulse (which includes auto-pickup) every N minutes:
Expand Down
Loading