From 7102ee695aee70c8ac9046af454bbb81ea825b5d Mon Sep 17 00:00:00 2001 From: Alexander Whitestone Date: Sat, 14 Mar 2026 18:17:44 -0400 Subject: [PATCH] fix: feed Timmy the PR info directly instead of asking him to query Gitea Timmy doesn't have Gitea access in CLI chat mode. Instead of asking him to check for PRs (which he can't), we fetch the latest merged PR and commit summary ourselves and ask for his opinion on the change. --- bin/timmy-loop.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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=$?