From 6af8f002f57044a2912a690f2208e6b2fa54dacb Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 14 Apr 2026 22:37:24 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20bug:=20entrypoint.sh=20`wait`=20(no-args?= =?UTF-8?q?)=20serializes=20polling=20loop=20behind=20long-lived=20dev-age?= =?UTF-8?q?nt/gardener=20=E2=80=94=20causes=20system-wide=20deadlock=20(#7?= =?UTF-8?q?53)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- docker/agents/entrypoint.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docker/agents/entrypoint.sh b/docker/agents/entrypoint.sh index d63c40a..9df6d01 100644 --- a/docker/agents/entrypoint.sh +++ b/docker/agents/entrypoint.sh @@ -385,11 +385,13 @@ print(cfg.get('primary_branch', 'main')) log "Processing project TOML: ${toml}" # --- Fast agents: run in background, wait before slow agents --- + FAST_PIDS=() # Review poll (every iteration) if [[ ",${AGENT_ROLES}," == *",review,"* ]]; then log "Running review-poll (iteration ${iteration}) for ${toml}" gosu agent bash -c "cd ${DISINTO_DIR} && bash review/review-poll.sh \"${toml}\"" >> "${DISINTO_LOG_DIR}/review-poll.log" 2>&1 & + FAST_PIDS+=($!) fi sleep 2 # stagger fast polls @@ -398,10 +400,14 @@ print(cfg.get('primary_branch', 'main')) if [[ ",${AGENT_ROLES}," == *",dev,"* ]]; then log "Running dev-poll (iteration ${iteration}) for ${toml}" gosu agent bash -c "cd ${DISINTO_DIR} && bash dev/dev-poll.sh \"${toml}\"" >> "${DISINTO_LOG_DIR}/dev-poll.log" 2>&1 & + FAST_PIDS+=($!) fi - # Wait for fast polls to finish before launching slow agents - wait + # Wait only for THIS iteration's fast polls — long-running gardener/dev-agent + # from prior iterations must not block us. + if [ ${#FAST_PIDS[@]} -gt 0 ]; then + wait "${FAST_PIDS[@]}" + fi # --- Slow agents: run in background with pgrep guard ---