Skip to content

[aw-failures] [aw] Fix Code Simplifier agent runaway — 244 turns / 12.3M tokens / 4,219 AIC in one run #38809

@github-actions

Description

@github-actions

Parent: #38807

Problem statement

Cap the Code Simplifier agent loop — one scheduled run consumed 84% of the entire 5000 daily AIC budget and still hard-failed. On 2026-06-12 the Code Simplifier workflow ran for 32.8 minutes across 244 turns, consuming 12,306,086 tokens (4,219.8 AIC), then the agent job terminated in failure with no structured error and zero write actions produced. The run was pure read-only churn that delivered nothing and nearly exhausted the shared daily credit pool that other workflows depend on.

Affected workflows and run IDs

  • Workflow: Code Simplifier (engine: GitHub Copilot CLI 1.0.60, model claude-sonnet-4.6, scheduled)
  • Run: 27395179213agent job failure, 32.8m, 244 turns, 12.3M tokens, 4,219.8 AIC, 0 safe outputs, 670 firewall requests / 0 blocked.

Probable root cause

Unbounded agentic iteration. The audit classifies the run as Resource Heavy For Domain (high) and Many Iterations (244 turns), with ~50% of turns being data-gathering reducible to deterministic steps. The combination of an absent or too-high max-turns/per-run AIC cap and an exploratory prompt let the agent loop until the job process died, rather than exiting cleanly. This is distinct from the daily-guardrail activation blocks (parent Cluster A): here the agent itself ran away mid-execution.

Proposed remediation

  1. Add a per-run hard ceiling to the Code Simplifier frontmatter: a conservative max-turns (e.g. 40–60) and a per-run AIC/token budget so a single run cannot approach the daily cap.
  2. Ensure the agent exits gracefully (emit noop / partial result) when the ceiling is hit instead of letting the agent job crash with no structured error.
  3. Move the ~50% deterministic data-gathering turns to pre-agent steps: writing to /tmp/gh-aw/agent/ per the DeterministicOps guide, shrinking the agentic surface.
  4. Align with the soft pre-cap AIC guard work in [deep-report] Add a soft pre-cap AI-credits guard to heavy aggregator workflows #38645 so per-run and daily budgets are enforced consistently.

Success criteria / verification

  • A scheduled Code Simplifier run completes (or cleanly no-ops) in well under its previous 32.8m / 244-turn profile.
  • No single run exceeds the new per-run AIC/token ceiling; audit no longer flags Resource Heavy For Domain (high) or 244-turn Many Iterations.
  • When the ceiling is hit, the agent job ends success with an explicit noop/partial-result safe output rather than a hard failure.
  • Verified against a follow-up audit of the next scheduled Code Simplifier run.
    Related to [aw-failures] [aw] Failure Investigator — 6h Review (2026-06-12 08:14 UTC) #38807

Generated by 🔍 [aw] Failure Investigator (6h) · 195.9 AIC · ⌖ 14.4 AIC · ⊞ 5.1K ·

  • expires on Jun 19, 2026, 12:25 AM UTC-08:00

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions