Skip to content

[agentic-token-optimizer] Design Decision Gate: switch off Opus, skip agent on checkout failure (~20 AIC/run) #70904

Closed as not planned

Description

@github-actions

Target workflow

Design Decision Gate 🏗️ (.github/workflows/design-decision-gate.md). It is the #2 workflow by AIC over the last 7 days. #1 (Matt Pocock Skills Reviewer) and #3 (Avenger) were optimized within the last 14 days, so they were skipped.

Analysis period

Last 7 days, 5 runs analyzed (2 success, 3 failure). All five were pull_request events.

Cost profile

Metric Value
Total AIC 121.7
Avg AIC/run 24.3 (success runs ≈ 28.5–29.1)
Raw tokens 64,262 total (failed runs ≈ 27.8k each, successful runs ≈ 4.2–4.4k each)
Avg turns/run not reported by the run data (shows 0)
Successful-run tokens input 18, output ~4.2–4.4k, cache read ~175k, cache write ~33.5k
Cache efficiency cache read is ~5× cache write, so caching works. Cost is driven by model price and context size, not by cache misses.
Session size about 225 session events per successful run

Ranked recommendations

1. Use a cheaper model (est. −15 to −20 AIC/run)

  • Action: replace model: copilot/claude-opus-5.5 with a mid-tier model (for example a Sonnet-class model).

  • Evidence:

    • The task is mostly classification (does the PR need an ADR?), and the final output is a short comment or a templated ADR draft.
    • A successful run produces only ~4.2k output tokens but costs ~28.5 AIC.
    • Check ADR draft quality on the next few runs and revert if it drops.

2. Skip the agent when PR branch checkout fails (est. −32 AIC per failed run)

  • Action: make the agent job fail fast, or conditionally skip, when Checkout PR branch fails. Alternatively, have the pre-fetch step detect a missing branch and set skip_reason.

  • Evidence:

    • Runs §39618696347 and §39614442359 failed at Checkout PR branch. The error was git fetch failed with exit code 128 for branch chore/remove-dead-functions-... on PR 70898.
    • Despite the failure, they were billed about 32 AIC each, the highest per-run AIC in the sample. About 64 of the 121.7 AIC (53%) went to failed runs.
  • Caveat: I did not confirm why the fetch failed (a deleted or renamed branch is plausible). Treat the cause as unconfirmed.

3. Align the turn budget and prompt (est. −2 to −4 AIC/run)

  • Action: the frontmatter has max-turns: 30, but the prompt says "Hard Turn Budget: 20" and "Total ≤ 7". Set max-turns to about 12 and remove the duplicated stop rules. The Mandatory Stopping Criteria and Efficiency Rules overlap with the turn table.
  • Evidence: successful runs have 225 session events, far more than the 7-turn plan implies.

4. Narrow bash: ["*"] (reliability and token hygiene, low savings)

  • Action: the prompt only needs find, cat and mkdir. Use a restricted allowlist (for example ["find","cat","mkdir","ls"]).
  • Caveat: I did not audit per-tool usage in the run logs. Confirm no other command is used in a successful run before narrowing.

Structural optimizations

None recommended. The prompt has only about 4 sections, and the steps depend on each other (summary → PR details → ADR check → output). Moving them to inline sub-agents would add overhead without savings. The prefetch step already runs in setup steps, so there is no repeated setup prefix to extract.

Caveats

  • Only 5 runs are in the window, and 3 of them failed (one in 7s, with 0 AIC).
  • The AIC savings estimates are not measured. They assume a roughly 3–5× cheaper model class.
  • Turn counts are missing from the run data.
  • Recommendation 2 assumes failed-checkout runs are billed as observed. The Pi engine run appears to continue past the checkout error.
Per-run evidence
Run Result AIC Raw tokens Duration
§39618696347 failure (checkout) 32.10 27,852 5.4m
§39616146839 success 28.51 4,182 9.4m
§39615568992 success 29.09 4,405 13.0m
39615043525 failure 0 0 7s
39614442359 failure (checkout) 32.01 27,823 4.6m

References: §39618696347, §39616146839, §39615568992

Generated by Agentic Workflow AIC Usage Optimizer · copilot · auto · 23.9 AIC · ⊞ 11K · ◷

  • expires on Oct 28, 2026, 7:00 AM UTC-08:00

Activity

  1. github-actions commented on Oct 23, 2026

    @github-actions
    ContributorAuthor

    This issue is being closed as outdated. A newer issue has been created: #71459

    View newer issue


    This action was performed automatically by the Agentic Workflow AIC Usage Optimizer workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions