Skip to content

ci: harden the agent loop — turn-cap headroom + failure surfacing#56

Merged
williamdewitt merged 1 commit into
mainfrom
ci/harden-agent-loop
Jun 27, 2026
Merged

ci: harden the agent loop — turn-cap headroom + failure surfacing#56
williamdewitt merged 1 commit into
mainfrom
ci/harden-agent-loop

Conversation

@williamdewitt

Copy link
Copy Markdown
Owner

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

  1. Turn-cap headroom: --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.
  2. Failure surfacing: a new if: failure() step comments the run link on the issue and labels it needs-triage, so a failed run is visible in the hands-off model instead of dying silently in the Actions tab.

Safety

  • The failure step posts with the default GITHUB_TOKEN — a notification, never a re-trigger: github-actions[bot] is excluded by the trusted-actor guard, and GITHUB_TOKEN-triggered runs are suppressed, so it cannot re-invoke the agent.
  • YAML validated; step count 4 → 5.

risk:core (.github/workflows/**) → CODEOWNERS review required; does not auto-merge.

🤖 Generated with Claude Code

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>
@github-actions github-actions Bot added the risk:core src/Caliber.Webhooks; code-owner review (Opus, high effort) label Jun 26, 2026
@williamdewitt williamdewitt merged commit 84686bf into main Jun 27, 2026
7 checks passed
@williamdewitt williamdewitt deleted the ci/harden-agent-loop branch June 27, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:core src/Caliber.Webhooks; code-owner review (Opus, high effort)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant