fix: Coordinate review injection between review-poll.sh and dev-agent.sh to prevent double-injection (#90)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-18 09:01:50 +00:00
parent a340e57789
commit 19a245fe5e
2 changed files with 13 additions and 0 deletions

View file

@ -1239,6 +1239,8 @@ Instructions:
# Do NOT update LAST_PHASE_MTIME here — leave it stale so the outer
# loop detects the change on its next tick and dispatches the new phase.
REVIEW_FOUND=true # Prevent timeout injection
# Clean up review-poll sentinel if it exists (session already advanced)
rm -f "/tmp/review-injected-${PROJECT_NAME}-${PR_NUMBER}"
break
fi
@ -1273,6 +1275,15 @@ Instructions:
[ -n "$VERDICT" ] && log "verdict from formal review: $VERDICT"
fi
# Skip injection if review-poll.sh already injected (sentinel present)
REVIEW_SENTINEL="/tmp/review-injected-${PROJECT_NAME}-${PR_NUMBER}"
if [ -n "$VERDICT" ] && [ -f "$REVIEW_SENTINEL" ]; then
log "review already injected by review-poll (sentinel exists) — skipping"
rm -f "$REVIEW_SENTINEL"
REVIEW_FOUND=true
break
fi
if [ "$VERDICT" = "APPROVE" ]; then
REVIEW_FOUND=true
inject_into_session "Approved! PR #${PR_NUMBER} has been approved by the reviewer.