]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ci: Bump number of turns for claude and mention turns in prompt
authorDaan De Meyer <daan@amutable.com>
Wed, 18 Mar 2026 10:46:01 +0000 (11:46 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 18 Mar 2026 11:00:48 +0000 (12:00 +0100)
claude keeps failing by its subagents completing after it has already
written the review for large prs. It seems to run out of turns, tries
to get the subagents to post partial reviews but doesn't seem to stop
them.

Let's insist that it waits for background tasks to stop but let's also
increase the max turns a bit so it doesn't run out as quickly.

.github/workflows/claude-review.yml

index dbab77b2e721606a63bda01a5b4b9d98d645f9eb..168e658e8a36865101f1807370106db507a11e15 100644 (file)
@@ -247,7 +247,7 @@ jobs:
             }
           claude_args: |
             --model us.anthropic.claude-opus-4-6-v1
-            --max-turns 100
+            --max-turns 200
             --disallowedTools "WebFetch,WebSearch"
             --json-schema '${{ env.REVIEW_SCHEMA }}'
           prompt: |
@@ -302,7 +302,11 @@ jobs:
 
               ## Phase 3: Collect, deduplicate, and summarize
 
-              After ALL commit review subagents complete:
+              Wait for all commit review subagents to complete. Monitor your
+              remaining turns — if you are running low (fewer than 20 turns
+              left), immediately stop all still-running subagents using
+              TaskStop and proceed with whatever results you have so far. A
+              partial review is better than no review. Then:
               1. Collect all issues. Merge duplicates (same file, lines within 3 of each other, same problem).
               2. Drop low-confidence findings.
               3. Check the existing inline review comments fetched in Phase 1. Do NOT include a
@@ -365,10 +369,12 @@ jobs:
 
               ## CRITICAL: Return structured JSON output
 
-              Before returning structured output, cancel ALL running background tasks
-              using the TaskStop tool. A background task completing after you return
-              structured output will trigger a new conversation turn that overwrites your
-              result and causes the workflow to fail.
+              Before returning structured output, stop ALL running background tasks
+              using TaskStop and wait for each one to fully terminate. Do NOT
+              return structured output while any background task is still
+              running — a background task completing after you return will
+              trigger a new conversation turn that overwrites your result and
+              causes the workflow to fail.
 
               Your FINAL action must be to return a JSON object matching the following
               JSON schema — do NOT end with a text summary or narrative. The `--json-schema`