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) <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-21 17:14:54 +00:00
parent 01a50aaa3d
commit 1604d1e062

View file

@ -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