From 9b9f6717d03486808907cd20204622654113130d Mon Sep 17 00:00:00 2001 From: openhands Date: Wed, 25 Mar 2026 17:31:00 +0000 Subject: [PATCH] fix: action agent should check issue dependencies before spawning Claude (#688) Co-Authored-By: Claude Opus 4.6 (1M context) --- action/action-agent.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/action/action-agent.sh b/action/action-agent.sh index 3c54396..d9daea5 100755 --- a/action/action-agent.sh +++ b/action/action-agent.sh @@ -152,6 +152,27 @@ fi log "Issue: ${ISSUE_TITLE}" +# --- Dependency check (skip before spawning Claude) --- +DEPS=$(printf '%s' "$ISSUE_BODY" | bash "${FACTORY_ROOT}/lib/parse-deps.sh") +if [ -n "$DEPS" ]; then + ALL_MET=true + while IFS= read -r dep; do + [ -z "$dep" ] && continue + DEP_STATE=$(curl -sf -H "Authorization: token ${FORGE_TOKEN}" \ + "${FORGE_API}/issues/${dep}" | jq -r '.state // "open"') || DEP_STATE="open" + if [ "$DEP_STATE" != "closed" ]; then + log "SKIP: dependency #${dep} still open — not spawning session" + ALL_MET=false + break + fi + done <<< "$DEPS" + if [ "$ALL_MET" = false ]; then + rm -f "$LOCKFILE" + exit 0 + fi + log "all dependencies met" +fi + # --- Extract model from YAML front matter (if present) --- YAML_MODEL=$(printf '%s' "$ISSUE_BODY" | \ sed -n '/^---$/,/^---$/p' | grep '^model:' | awk '{print $2}' | tr -d '"' || true)