From d40a9c36c512f4de4dc7c84c691e02a10063ab4f Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 19 Mar 2026 07:56:11 +0000 Subject: [PATCH 1/2] fix: dev-agent reads issue comments alongside body (#237) Fetches issue comments via Codeberg API and appends human comments to the issue body in the Claude prompt. Bot comments (Disinto_bot, disinto-factory) are filtered out. One API call, zero new dependencies. --- dev/dev-agent.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dev/dev-agent.sh b/dev/dev-agent.sh index f76b375..939e102 100755 --- a/dev/dev-agent.sh +++ b/dev/dev-agent.sh @@ -185,6 +185,17 @@ if [ -z "$ISSUE_JSON" ] || ! echo "$ISSUE_JSON" | jq -e '.id' >/dev/null 2>&1; t fi ISSUE_TITLE=$(echo "$ISSUE_JSON" | jq -r '.title') ISSUE_BODY=$(echo "$ISSUE_JSON" | jq -r '.body // ""') + +# Append human comments to issue body (filter out bot accounts) +ISSUE_COMMENTS=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \ + "${API}/issues/${ISSUE}/comments" | \ + jq -r '.[] | select(.user.login != "Disinto_bot" and .user.login != "disinto-factory") | "### @\(.user.login) (\(.created_at[:10])):\n\(.body)\n"' 2>/dev/null || true) +if [ -n "$ISSUE_COMMENTS" ]; then + ISSUE_BODY="${ISSUE_BODY} + +## Issue comments +${ISSUE_COMMENTS}" +fi ISSUE_STATE=$(echo "$ISSUE_JSON" | jq -r '.state') if [ "$ISSUE_STATE" != "open" ]; then From 7cf1d035e0df32f36f38ad8815f4af9b68c9fb45 Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 19 Mar 2026 08:25:02 +0000 Subject: [PATCH 2/2] fix: use original issue body for dep parsing and PR recovery detection Prevent human comments appended to ISSUE_BODY from causing false positive dependency blocks or spurious 'Existing PR:' recovery matches in parse-deps.sh and the PR recovery guard. Co-Authored-By: Claude Sonnet 4.6 --- dev/dev-agent.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dev/dev-agent.sh b/dev/dev-agent.sh index 939e102..6a5a2ea 100755 --- a/dev/dev-agent.sh +++ b/dev/dev-agent.sh @@ -185,6 +185,7 @@ if [ -z "$ISSUE_JSON" ] || ! echo "$ISSUE_JSON" | jq -e '.id' >/dev/null 2>&1; t fi ISSUE_TITLE=$(echo "$ISSUE_JSON" | jq -r '.title') ISSUE_BODY=$(echo "$ISSUE_JSON" | jq -r '.body // ""') +ISSUE_BODY_ORIGINAL="$ISSUE_BODY" # Append human comments to issue body (filter out bot accounts) ISSUE_COMMENTS=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \ @@ -222,8 +223,8 @@ fi # ============================================================================= status "preflight check" -# Extract dependency references using shared parser -DEP_NUMBERS=$(echo "$ISSUE_BODY" | bash "${FACTORY_ROOT}/lib/parse-deps.sh") +# Extract dependency references using shared parser (use original body only — not comments) +DEP_NUMBERS=$(echo "$ISSUE_BODY_ORIGINAL" | bash "${FACTORY_ROOT}/lib/parse-deps.sh") BLOCKED_BY=() if [ -n "$DEP_NUMBERS" ]; then @@ -357,7 +358,7 @@ EXISTING_PR="" EXISTING_BRANCH="" RECOVERY_MODE=false -BODY_PR=$(echo "$ISSUE_BODY" | grep -oP 'Existing PR:\s*#\K[0-9]+' | head -1) || true +BODY_PR=$(echo "$ISSUE_BODY_ORIGINAL" | grep -oP 'Existing PR:\s*#\K[0-9]+' | head -1) || true if [ -n "$BODY_PR" ]; then PR_CHECK=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \ "${API}/pulls/${BODY_PR}" | jq -r '{state, head_ref: .head.ref}')