fix: ensure agent loop continues after Claude timeout or API errors#165
Open
LeeCampbell wants to merge 1 commit intoHdrHistogram:mainfrom
Open
fix: ensure agent loop continues after Claude timeout or API errors#165LeeCampbell wants to merge 1 commit intoHdrHistogram:mainfrom
LeeCampbell wants to merge 1 commit intoHdrHistogram:mainfrom
Conversation
The agent loop would stop iterating when Claude exited with a non-zero, non-124 exit code. This prevented the state machine from advancing to the create-pr state after a successful execute-tasks phase where Claude timed out but sync_state had already committed and pushed the work. - Remove global CLAUDE_RC; run_claude now returns its exit code directly - Add || true to all run_claude call sites so sync_state always runs - Log Claude exit codes as warnings rather than swallowing them - entrypoint.sh no longer breaks the loop on non-zero exit codes, letting the state machine advance to the next phase Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
create-prafter a successfulexecute-taskswhere sync_state had already committed and pushedrun_claudenow returns its exit code directly; callers use|| truesosync_statealways runsentrypoint.shlogs non-zero exits as warnings and continues iterating instead of breakingRoot cause
Issue #141's container run completed all implementation work and benchmarks, but a sub-agent API timeout cascaded:
CLAUDE_RCwas set to non-zero,exit $CLAUDE_RCreturned that toentrypoint.sh, which broke the loop before the next iteration could reach thecreate-prstate (which is pure shell — no Claude needed).Test plan
./scripts/run.shwith a shortTIMEOUT_SECONDSto trigger a Claude timeoutcreate-prstate still executes after a timed-outexecute-tasks🤖 Generated with Claude Code