From d1378628139787f0080c29c215a608095af578a3 Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 13 Mar 2026 20:50:16 +0000 Subject: [PATCH] fix: gardener tech-debt promotion not surfaced as problem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tech-debt→backlog promotion was only in prompt text, not in the problem list. Claude focused on detected problems (dupes, thin issues) and printed CLEAN, ignoring the primary mission. Fix: explicitly list up to 10 tech-debt issues in the problem list so claude sees them as actionable items. Also bumped --max-turns from 10 to 30 — promoting issues requires reading + editing + relabeling via API, needs more turns. --- gardener/gardener-poll.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gardener/gardener-poll.sh b/gardener/gardener-poll.sh index 1a8f188..7dace81 100755 --- a/gardener/gardener-poll.sh +++ b/gardener/gardener-poll.sh @@ -130,6 +130,13 @@ while IFS=$'\t' read -r num body; do done done < <(echo "$ISSUES_JSON" | jq -r '.[] | "\(.number)\t\(.body // "")"' | head -20) +# 5. Tech-debt issues needing promotion to backlog (primary mission) +TECH_DEBT_ISSUES=$(echo "$ISSUES_JSON" | jq -r '.[] | select(.labels | map(.name) | index("tech-debt")) | "#\(.number) \(.title)"' | head -10) +if [ -n "$TECH_DEBT_ISSUES" ]; then + TECH_DEBT_COUNT=$(echo "$TECH_DEBT_ISSUES" | wc -l) + PROBLEMS="${PROBLEMS}tech_debt_promotion: ${TECH_DEBT_COUNT} tech-debt issues need promotion to backlog (max 10 per run):\n${TECH_DEBT_ISSUES}\n" +fi + PROBLEM_COUNT=$(echo -e "$PROBLEMS" | grep -c '.' || true) log "Detected $PROBLEM_COUNT potential problems" @@ -202,7 +209,7 @@ CLAUDE_OUTPUT=$(cd /home/debian/harb && timeout "$CLAUDE_TIMEOUT" \ claude -p "$PROMPT" \ --model sonnet \ --dangerously-skip-permissions \ - --max-turns 10 \ + --max-turns 30 \ 2>/dev/null) || true log "claude finished ($(echo "$CLAUDE_OUTPUT" | wc -c) bytes)"