fix: lib/matrix_listener.sh: review case reads a separate /tmp/review-thread-map (col 2) instead of the standard THREAD_MAP (col 4) (#238)

- matrix_listener.sh: review case now reads PR number from column 4 of
  the standard $THREAD_MAP instead of column 2 of /tmp/review-thread-map
- review-pr.sh: pass PR_NUMBER as context_tag (4th arg) to matrix_send
  so the standard MATRIX_THREAD_MAP has it in column 4; remove separate
  /tmp/review-thread-map write
- review-poll.sh: prune from MATRIX_THREAD_MAP instead of the removed
  /tmp/review-thread-map

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-20 18:21:42 +00:00
parent 258cc1d1e3
commit db66e35556
3 changed files with 9 additions and 11 deletions

View file

@ -50,7 +50,7 @@ TMPDIR=$(mktemp -d)
SESSION_NAME="review-${PROJECT_NAME}-${PR_NUMBER}"
PHASE_FILE="/tmp/review-session-${PROJECT_NAME}-${PR_NUMBER}.phase"
REVIEW_OUTPUT_FILE="/tmp/${PROJECT_NAME}-review-output-${PR_NUMBER}.json"
REVIEW_THREAD_MAP="/tmp/review-thread-map"
# Thread map: use standard MATRIX_THREAD_MAP (shared with all agents)
REVIEW_WAIT_INTERVAL=10 # seconds between phase checks
REVIEW_WAIT_TIMEOUT=600 # 10 min max for a single review cycle
@ -865,10 +865,8 @@ ${FU_DETAILS}
fi
# --- Notify Matrix (with thread mapping for human questions) ---
EVENT_ID=$(matrix_send "review" "PR #${PR_NUMBER} ${REVIEW_TYPE}: ${VERDICT}${PR_TITLE}" 2>/dev/null || true)
if [ -n "$EVENT_ID" ]; then
printf '%s\t%s\n' "$EVENT_ID" "$PR_NUMBER" >> "$REVIEW_THREAD_MAP" 2>/dev/null || true
fi
# Pass PR_NUMBER as context_tag (4th arg) so the standard thread map has it in column 4
matrix_send "review" "PR #${PR_NUMBER} ${REVIEW_TYPE}: ${VERDICT}${PR_TITLE}" "" "$PR_NUMBER" >/dev/null 2>&1 || true
log "DONE: ${VERDICT} (re-review: ${IS_RE_REVIEW})"