ci: harden the agent loop — turn-cap headroom + failure surfacing#56
Merged
Conversation
Two robustness fixes prompted by the S0 scaffold run hitting error_max_turns (it built everything but ran out of turns before committing, pushing nothing): - Raise --max-turns 30 -> 50 as a safety margin for a well-sized slice. Small slices remain the design (see CLAUDE.md); the cap still stops a runaway task. - Add a `failure()` step that, in the hands-off model, comments the run link on the issue and labels it needs-triage instead of failing silently in the Actions tab. Posted with GITHUB_TOKEN (a notification, never a re-trigger — the bot actor is excluded and GITHUB_TOKEN runs are suppressed, so it cannot re-invoke the agent). Co-Authored-By: Claude Opus 4.8 <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.
Rolls the S0 turn-cap fix into the system — the workflow half (the convention half is #55).
Prompted by the first S0 scaffold run failing on
error_max_turns: the agent built the whole scaffold but ran out of its 30-turn budget before committing, so nothing was pushed and the failure was only caught by a manual watcher.Changes to
claude.yml--max-turns 30 → 50. A safety margin for a well-sized slice; small slices remain the design (CLAUDE.md, docs: codify one-slice-one-run sizing for agent issues #55), and the cap still stops a runaway task.if: failure()step comments the run link on the issue and labels itneeds-triage, so a failed run is visible in the hands-off model instead of dying silently in the Actions tab.Safety
GITHUB_TOKEN— a notification, never a re-trigger:github-actions[bot]is excluded by the trusted-actor guard, andGITHUB_TOKEN-triggered runs are suppressed, so it cannot re-invoke the agent.risk:core(.github/workflows/**) → CODEOWNERS review required; does not auto-merge.🤖 Generated with Claude Code