Skip to content

fix(instructions-janitor): pin model, bound git history, add early exit to reduce 40% failure rate - #48990

Merged
pelikhan merged 2 commits into
mainfrom
copilot/agentic-token-optimizer-reduce-failure-rate
Jul 29, 2026
Merged

fix(instructions-janitor): pin model, bound git history, add early exit to reduce 40% failure rate#48990
pelikhan merged 2 commits into
mainfrom
copilot/agentic-token-optimizer-reduce-failure-rate

Conversation

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

The Instructions Janitor workflow had a 40% failure rate over the last 10 runs: 3 runs crashed due to unpriced model routing and 1 timed out after 20 minutes with zero output.

Changes

Pin model to claude-sonnet-5

Three failures hit API Error: 400 Model "claude-opus-5" has no AI credits pricing. The bare engine: claude with no explicit model was being opportunistically routed onto an unpriced model, triggering 3 retries per failure and burning tokens with no artifact.

# before
engine: claude

# after
engine:
  id: claude
model: claude-sonnet-5

Bound git-history exploration

The most recent run timed out at 20 min while chaining unbounded git log, per-commit git show --stat, and repeated git log --since calls. The Release/Change audit now specifies:

  • one git log --since=<date> --name-only pass
  • one batched git diff <tag>..HEAD -- docs/ .github/aw/
  • hard cap of 5 individual commit inspections

Two new bash allowlist entries (git diff *..HEAD -- docs/ .github/aw/ and git show --stat *) support this pattern.

Early no-op short-circuit

The no-op exit was only reachable after all four audits completed. A new Edge Case allows exiting immediately after the Release/Change + Size audits when no relevant changes exist and all files are within limits, skipping the Duplication and Accuracy passes.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Reduce failure rate and wasted retries in Instructions Janitor fix(instructions-janitor): pin model, bound git history, add early exit to reduce 40% failure rate Jul 29, 2026
Copilot AI requested a review from pelikhan July 29, 2026 22:17
@pelikhan
pelikhan marked this pull request as ready for review July 29, 2026 22:21
Copilot AI review requested due to automatic review settings July 29, 2026 22:21
@pelikhan
pelikhan merged commit b8e3d31 into main Jul 29, 2026
@pelikhan
pelikhan deleted the copilot/agentic-token-optimizer-reduce-failure-rate branch July 29, 2026 22:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Pins the Instructions Janitor model and reduces unnecessary audit work.

Changes:

  • Pins claude-sonnet-5.
  • Adds bounded history inspection commands.
  • Adds an early no-op exit.
Show a summary per file
File Description
.github/workflows/instructions-janitor.md Updates model and audit instructions.
.github/workflows/instructions-janitor.lock.yml Regenerates the compiled workflow.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Medium


## Edge Cases

- if the Release/Change audit finds no relevant docs or `.github/aw/` changes **and** the Size audit confirms all files are under their limits, exit immediately without running the Duplication or Accuracy audits
```
- if there are relevant changes, run one batched diff to review all affected content at once:
```bash
git diff <release-tag>..HEAD -- docs/ .github/aw/
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.1

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[agentic-token-optimizer] Instructions Janitor: reduce failure rate and wasted retries (40% of last 10 runs failed)

3 participants