diff --git a/bin/timmy-loop.sh b/bin/timmy-loop.sh index f39252a..a2315ad 100755 --- a/bin/timmy-loop.sh +++ b/bin/timmy-loop.sh @@ -192,7 +192,16 @@ $PROMPT" # ── Post-cycle: Ask Timmy to review ─────────────────────────── log "Asking Timmy to review cycle output..." - REVIEW=$(ask_timmy "Cycle $CYCLE just completed. Check if there are any new PRs on Gitea. If there is one, read it and give a brief code review opinion — does it look good? Any concerns? Two sentences max.") + # Get the latest PR diff and feed it to Timmy directly + LATEST_PR=$(curl -s "http://localhost:3000/api/v1/repos/rockachopa/Timmy-time-dashboard/pulls?state=closed&sort=created&limit=1" \ + -H "Authorization: token $(cat ~/.hermes/gitea_token)" 2>/dev/null | python3 -c " +import json,sys +prs=json.load(sys.stdin) +if prs: print(f'PR #{prs[0][\"number\"]}: {prs[0][\"title\"]}') +else: print('none') +" 2>/dev/null) + DIFF_SUMMARY=$(cd "$REPO" && git log --oneline -1 2>/dev/null) + REVIEW=$(ask_timmy "The dev loop just merged $LATEST_PR (commit: $DIFF_SUMMARY). Based on what you know about your own architecture, does this sound like a good change? Any concerns? Two sentences max.") log "Timmy's review: $REVIEW" else EXIT_CODE=$?