disinto/dev
openhands 7bf13567fd fix: TOCTOU in handle_ci_exhaustion: check-then-act not atomic (#125)
Add ci_fix_check_and_increment() that performs read + threshold-check +
conditional increment in a single flock-protected Python call, replacing
the prior three-step sequence (ci_fix_count / bash check / ci_fix_increment)
that allowed two concurrent poll invocations to both pass the threshold and
spawn duplicate dev-agents for the same PR.

handle_ci_exhaustion now calls ci_fix_check_and_increment atomically and
returns the new count in CI_FIX_ATTEMPTS; all separate ci_fix_increment
calls after handle_ci_exhaustion (including the deferred READY_PR_FOR_INCREMENT
mechanism) are removed. Log messages updated from CI_FIX_ATTEMPTS+1 to
CI_FIX_ATTEMPTS to reflect the post-increment count.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 10:22:24 +00:00
..
dev-agent.sh fix: CODEBERG_WEB not exported from lib/env.sh — other agents may hit the same gap (#129) 2026-03-18 09:40:20 +00:00
dev-poll.sh fix: TOCTOU in handle_ci_exhaustion: check-then-act not atomic (#125) 2026-03-18 10:22:24 +00:00
phase-test.sh fix: needs_human notification sent every poll cycle pre-PR (#103) 2026-03-18 07:35:13 +00:00