Skip to content
Merged
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
5 changes: 4 additions & 1 deletion .agents/scripts/supervisor-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3197,7 +3197,10 @@ check_task_already_done() {
local first_match=""
first_match=$(grep -E "^\s*- \[(x| |-)\] ${task_id}[[:space:]]" "$todo_file" 2>/dev/null | head -1) || true
if [[ -n "$first_match" ]]; then
if [[ "$first_match" =~ \[x\] ]]; then
# 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
Comment on lines +3200 to +3203

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

log_info "Pre-dispatch check: $task_id is marked [x] in TODO.md (first occurrence)" >&2
return 0
else
Expand Down
Loading