From fbe645a30532e0914fc9e4310ce7f71331a8f0a4 Mon Sep 17 00:00:00 2001 From: openhands Date: Mon, 23 Mar 2026 08:16:13 +0000 Subject: [PATCH] fix: BACKLOG_NUMS array in supervisor-poll.sh is never queried (#110) The BACKLOG_NUMS associative array was built to track which issue numbers are in the backlog, but the DFS cycle-detection code used NODE_COLOR as a membership guard instead. This meant deps pointing to non-backlog issues were only skipped by coincidence (they weren't in NODE_COLOR either). Three changes: - Remove SC2034 suppression since BACKLOG_NUMS is now actually queried - Initialize NODE_COLOR from BACKLOG_NUMS keys (all backlog issues) instead of DEPS_OF keys (only issues with dependencies), so every backlog issue gets a proper DFS color - Replace the NODE_COLOR membership check with BACKLOG_NUMS in the DFS, so the guard explicitly asks "is this dep a backlog issue?" rather than relying on NODE_COLOR initialization as a proxy Co-Authored-By: Claude Opus 4.6 (1M context) --- supervisor/supervisor-poll.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/supervisor/supervisor-poll.sh b/supervisor/supervisor-poll.sh index da1cb97..1047b8e 100755 --- a/supervisor/supervisor-poll.sh +++ b/supervisor/supervisor-poll.sh @@ -467,12 +467,11 @@ check_project() { BODY=$(echo "$BACKLOG_FOR_DEPS" | jq -r ".[$i].body // \"\"") ISSUE_DEPS=$(echo "$BODY" | bash "$PARSE_DEPS" | grep -v "^${NUM}$" || true) [ -n "$ISSUE_DEPS" ] && DEPS_OF[$NUM]="$ISSUE_DEPS" - # shellcheck disable=SC2034 BACKLOG_NUMS[$NUM]=1 done declare -A NODE_COLOR - for node in "${!DEPS_OF[@]}"; do NODE_COLOR[$node]=0; done + for node in "${!BACKLOG_NUMS[@]}"; do NODE_COLOR[$node]=0; done FOUND_CYCLES="" declare -A SEEN_CYCLES @@ -481,7 +480,7 @@ check_project() { local node="$1" path="$2" NODE_COLOR[$node]=1 for dep in ${DEPS_OF[$node]:-}; do - [ -z "${NODE_COLOR[$dep]+x}" ] && continue + [ -z "${BACKLOG_NUMS[$dep]+x}" ] && continue if [ "${NODE_COLOR[$dep]}" = "1" ]; then local cycle_key cycle_key=$(echo "$path $dep" | tr ' ' '\n' | sort -n | tr '\n' ' ')