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.
This commit is contained in:
@@ -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=$?
|
||||
|
||||
Reference in New Issue
Block a user