Enhance AGENTS.md formatting warnings to prevent recurring CI failures #10008
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.
AI agents repeatedly commit unformatted Go code, causing 5 identical CI failures in one day. The existing
make agent-finishwarnings in AGENTS.md are insufficiently prominent.Changes
Critical Requirements Section
*.go→make fmt,*.md→make recompile,*.cjs→make fmt-cjs)make fmt+make test-unit(replaces 10minmake agent-finish)Quick Reference Section
Example
Before:
After:
Original prompt
This section details on the original issue you should resolve
<issue_title>[CI Failure Doctor] Recurring CI failure: Check Go formatting step fails - 5th occurrence today</issue_title>
<issue_description># 🏥 CI Failure Investigation - Run githubnext/gh-aw#29602
Summary
The CI workflow failed because Go code was not properly formatted before committing. The "Check Go formatting" step in the
lint-gojob detected unformatted Go files.Failure Details
030f506d2354f66024247585b91e19301f9ddbf6pushtomainbranchlint-go(Job githubnext/gh-aw#60410207744)Root Cause Analysis
Primary Cause
The AI agent (Copilot) committed code changes without running the mandatory pre-commit command:
make agent-finish(or at minimummake fmt).Pattern Recognition
This failure matches the known pattern
GO_FORMAT_CHECK_FAILEDwith high confidence:lint-gojob →Check Go formattingstep failureWhy This Keeps Happening
make agent-finishbefore every commitSuspicious Commit Characteristics
The PR #9997 only changed 2 files:
docs/src/content/docs/setup/quick-start.md(the intended documentation change).github/workflows/glossary-maintainer.lock.yml(regenerated workflow file)However, the commit statistics show hundreds of Go files modified. This suggests either:
The formatting check caught the issue regardless of the source.
Failed Jobs and Errors
Job:
lint-goStatus: ❌ Failed
Duration: ~17 seconds (22:38:03 - 22:38:20)
Failed Step: Check Go formatting (step 5)
Step Flow:
Expected Error (based on pattern):
Investigation Findings
Historical Context
This is part of a systematic issue where AI agents repeatedly commit code without proper formatting:
Pattern: All failures are from Copilot (AI agent) commits.
Impact Assessment
make fmtand push)Recommended Actions
Immediate Fix (For This Specific Failure)
Short-term Prevention (Reduce Recurrence)
AGENTS.mdabout mandatorymake agent-finishmake agent-finishLong-term Solutions (Eliminate Recurrence)
Add pre-commit hooks: Install Git hooks that automatically run
make fmtbefore commitsAuto-formatting PR workflow: Add a GitHub Action that automatically formats co...
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.