From 1604d1e06214c0f4d25efef31b1a44157915d12c Mon Sep 17 00:00:00 2001 From: openhands Date: Sat, 21 Mar 2026 17:14:54 +0000 Subject: [PATCH] fix: `idle_pane_count` not reset in phase-changed branch of monitor_phase_loop (#436) When a phase change is detected (mtime changes), idle_elapsed was reset but idle_pane_count was not. This meant idle counts accumulated before a phase write carried into subsequent polls, so N consecutive idle polls could be reached with fewer than N actual consecutive idle polls. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/agent-session.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/agent-session.sh b/lib/agent-session.sh index ffd71b1..269e94a 100644 --- a/lib/agent-session.sh +++ b/lib/agent-session.sh @@ -399,6 +399,7 @@ monitor_phase_loop() { # shellcheck disable=SC2034 # read by phase-handler.sh callback LAST_PHASE_MTIME="$phase_mtime" idle_elapsed=0 + idle_pane_count=0 # Terminal phases case "$current_phase" in