Skip to content

Commit ef8e635

Browse files
committed
fix(issue-auto-implement): timeout, failure comment, skip verify when no code changes
- Increase Claude Code CLI timeout from 25 to 35 minutes (ETIMEDOUT on complex issues) - When Claude writes only .comment_body (no code changes), skip verify and exit success - Update failure comment to mention timeout/CLI failure, not only verification - Add README section: Diagnosing run failures (ETIMEDOUT, implement vs verify) Made-with: Cursor
1 parent e490ace commit ef8e635

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

.github/actions/issue-auto-implement/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ No other setup is required. Optionally set `verify_commands` (default `go test .
7373

7474
The action ensures these labels exist (creates them if missing): `{prefix}/auto-implement`, `{prefix}/needs-info`, `{prefix}/pr-created`.
7575

76+
## Diagnosing run failures (exit code 1)
77+
78+
When a run fails, open the job log and check the **Implement and verify (loop)** step:
79+
80+
- **`Error: spawnSync claude ETIMEDOUT`** — The Claude Code CLI hit the timeout in `implement.ts` (default 35 minutes). The runner killed the subprocess before Claude finished. Increase the timeout in `assess/src/implement.ts` (e.g. to 35–40 min) or simplify the issue scope. The issue comment will say "verification failed" but the real cause is implement timeout.
81+
- **Other failure right after `npx tsx src/implement.ts`** — The implement script exited 1. Common causes: Claude Code CLI exited non-zero (error) or missing env (e.g. fetch issue failed). Check stderr for the exact error.
82+
- **"Verification failed (attempt 1 of N)" and eventually "Verification failed after N attempts"** — The verify command (e.g. `go test -short ./...`) failed on every attempt. Fix the failing tests or adjust `verify_commands` in the workflow.
83+
84+
When the issue is **already implemented** and Claude correctly writes only `.comment_body` (no code changes), the loop skips verification and exits success so the run completes and a PR/comment is posted.
85+
7686
## Testing
7787

7888
From the repo root, run the assess script tests:

.github/actions/issue-auto-implement/action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,16 @@ runs:
229229
CHANGES_PUSHED="true"
230230
else
231231
echo "No changes to commit (attempt $i)."
232+
# When Claude wrote only .comment_body (e.g. "already implemented"), skip verify and succeed
233+
if [ -f ".github/actions/issue-auto-implement/.comment_body" ]; then
234+
echo "No code changes and .comment_body present; skipping verify and exiting success."
235+
PR_DIR=".github/actions/issue-auto-implement"
236+
if [ -f "$PR_DIR/.pr_title" ]; then echo "pr_title<<__HOOKDECK_PR_TITLE_END_8a3f2b1c9d4e__" >> $GITHUB_OUTPUT; cat "$PR_DIR/.pr_title" >> $GITHUB_OUTPUT; echo "__HOOKDECK_PR_TITLE_END_8a3f2b1c9d4e__" >> $GITHUB_OUTPUT; else echo "pr_title=Implement issue #${ISSUE_NUMBER}" >> $GITHUB_OUTPUT; fi
237+
if [ -f "$PR_DIR/.pr_body" ]; then echo "pr_body<<__HOOKDECK_PR_BODY_END_8a3f2b1c9d4e__" >> $GITHUB_OUTPUT; cat "$PR_DIR/.pr_body" >> $GITHUB_OUTPUT; echo "__HOOKDECK_PR_BODY_END_8a3f2b1c9d4e__" >> $GITHUB_OUTPUT; else echo "pr_body=Closes #${ISSUE_NUMBER}" >> $GITHUB_OUTPUT; fi
238+
echo "verified=true" >> $GITHUB_OUTPUT
239+
echo "changes_pushed=$CHANGES_PUSHED" >> $GITHUB_OUTPUT
240+
exit 0
241+
fi
232242
fi
233243
VERIFY_OUTPUT=$(eval "$VERIFY_CMDS" 2>&1); VERIFY_EXIT=$?
234244
if [ "$VERIFY_EXIT" -eq 0 ]; then
@@ -261,7 +271,7 @@ runs:
261271
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
262272
MAX_RETRIES: ${{ inputs.max_implement_retries }}
263273
run: |
264-
BODY="The auto-implement run could not complete: verification failed after ${MAX_RETRIES} attempts. See the [workflow run]($RUN_URL) for logs. You can address the failure and re-trigger by adding a comment or re-applying the label."
274+
BODY="The auto-implement run could not complete. See the [workflow run]($RUN_URL) for logs. This can happen if the Claude Code CLI timed out or failed, or if verification (e.g. \`go test\`) failed after ${MAX_RETRIES} attempts. Re-trigger by adding a comment or re-applying the label."
265275
curl -s -X POST \
266276
-H "Authorization: Bearer $GITHUB_TOKEN" \
267277
-H "Accept: application/vnd.github+json" \

.github/actions/issue-auto-implement/assess/src/implement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function runClaudeCli(prompt: string): void {
125125
input: prompt,
126126
stdio: ['pipe', 'inherit', 'inherit'],
127127
encoding: 'utf-8',
128-
timeout: 25 * 60 * 1000, // 25 minutes
128+
timeout: 35 * 60 * 1000, // 35 minutes (complex issues or "already implemented" analysis may need more than 25)
129129
env,
130130
}
131131
);

0 commit comments

Comments
 (0)