From e7be534c7da25bdfb2eb6b9dec1a8c570ea8659d Mon Sep 17 00:00:00 2001 From: openhands Date: Sat, 21 Mar 2026 00:55:38 +0000 Subject: [PATCH] fix: Inner CI/review wait loops bypass exit_marker fast-path (#338) Add exit_marker file check to the CI wait loop and review wait loop in phase-handler.sh, matching the pattern already used in monitor_phase_loop (agent-session.sh). This makes crash detection consistent across all polling paths. Co-Authored-By: Claude Opus 4.6 (1M context) --- dev/phase-handler.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/phase-handler.sh b/dev/phase-handler.sh index 7248aeb..68d2ab6 100644 --- a/dev/phase-handler.sh +++ b/dev/phase-handler.sh @@ -249,8 +249,8 @@ Write PHASE:awaiting_review to the phase file, then stop and wait for review fee sleep 30 CI_POLL_ELAPSED=$(( CI_POLL_ELAPSED + 30 )) - # Check session still alive during CI wait - if ! tmux has-session -t "${SESSION_NAME}" 2>/dev/null; then + # Check session still alive during CI wait (exit_marker + tmux fallback) + if [ -f "/tmp/claude-exited-${SESSION_NAME}.ts" ] || ! tmux has-session -t "${SESSION_NAME}" 2>/dev/null; then log "session died during CI wait" break fi @@ -392,8 +392,8 @@ Instructions: sleep 300 # 5 min between review checks REVIEW_POLL_ELAPSED=$(( REVIEW_POLL_ELAPSED + 300 )) - # Check session still alive - if ! tmux has-session -t "${SESSION_NAME}" 2>/dev/null; then + # Check session still alive (exit_marker + tmux fallback) + if [ -f "/tmp/claude-exited-${SESSION_NAME}.ts" ] || ! tmux has-session -t "${SESSION_NAME}" 2>/dev/null; then log "session died during review wait" REVIEW_FOUND=false break