[gh-aw] Add nightly-fix-finder agentic workflow#11352
Conversation
Adds a gh aw workflow that runs nightly to scan the codebase for random improvement opportunities across 10 categories (TODO comments, nullable gaps, large files, obsolete APIs, test coverage, etc.). Each night it picks one category, finds a specific actionable issue, files a GitHub issue, and assigns Copilot with Claude Opus 4.6 via the assign-to-agent safe-output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces a new gh-aw nightly “fix finder” agentic workflow that scans src/ for a rotating set of code-quality signals, then creates (and optionally assigns) a focused GitHub issue for Copilot to address. It adds both the human-authored workflow source (.md) and the compiled lock workflow (.lock.yml) used by GitHub Actions.
Changes:
- Adds a nightly scheduled agentic workflow prompt + pre-scan bash step to generate
/tmp/gh-aw/agent/scan-results.md. - Configures safe outputs for
create-issue+assign-to-agent(Opus 4.6) and anooppath. - Checks in the generated
.lock.ymlproduced bygh aw compile.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| .github/workflows/nightly-fix-finder.md | Defines the workflow frontmatter, bash scan step, and the agent prompt/instructions. |
| .github/workflows/nightly-fix-finder.lock.yml | Auto-generated compiled workflow consumed by GitHub Actions runner. |
Automatically runs the nightly-fix-finder workflow when PRs modify either the .md source or .lock.yml compiled file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Use --exclude-dir=obj/bin instead of piping through grep -v - Replace slow find -exec grep per-file with grep -rL batch - Fix Category 8 regex: add grep -P for \s and \b support - Fix Category 4: adjust description since same-line /// check is unreliable, let the agent verify docs on preceding lines - Remove $(date) from prompt (not a shell context), reference the pre-computed scan results instead Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The first run showed the agent called assign_to_agent with only temporary_id but no issue_number, causing the assignment to be silently skipped. Updated the prompt to explicitly instruct the agent to pass issue_number referencing the create_issue temporary_id. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Allows the agent to read all issues (including community-filed) when checking for duplicates before filing a new issue. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The agent passed issue_number: "#aw_xdoc1" but the validator requires just "aw_xdoc1" (no # prefix) for temporary IDs. Also scope Category 4 (XML docs) to src/Mono.Android/ only — internal build tasks/tools do not need XML documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The default GITHUB_TOKEN lacks permission to assign the Copilot coding agent via GraphQL. Use ANDROID_TEAM_PAT which has the required scopes (same pattern as dotnet/android-libraries#1389). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
These are plumbing/bridge types (InputStreamInvoker, JNIEnv, etc.) that developers never interact with directly. Focus XML doc suggestions on user-facing APIs like Android.App, Android.Widget. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
.github/workflows/nightly-fix-finder.md:76
- Same pipefail issue for the nullable file count:
grep -rLreturns exit code 1 when it finds no files to print, which would fail the step under-e -o pipefail. Make this count command tolerant of “0 files” results so the workflow keeps running when the repo eventually fully opts into nullable.
grep -rL '#nullable enable' --include="*.cs" --exclude-dir=obj --exclude-dir=bin src/ 2>/dev/null | shuf | head -20 || echo "None found"
echo "### Total count"
grep -rL '#nullable enable' --include="*.cs" --exclude-dir=obj --exclude-dir=bin src/ 2>/dev/null | wc -l
- Replace deterministic date-based category (day%10) with \%10 so it doesn't pick the same category every run on the same day - Add || true to grep|wc -l pipelines to avoid pipefail abort - Fix grep -c || echo 0 double-output bug with || true + default Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/review |
|
✅ Android PR Reviewer completed successfully! |
The agent was ignoring the category index and always picking XML docs (Category 4) because it saw data for all categories. Now the bash step uses a case statement to only collect data for the randomly selected category, forcing the agent to work with whatever it gets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
✅ LGTM — Clean PR with minor suggestions
Well-designed nightly agentic workflow. The bash scan step is properly hardened (previous review feedback addressed), the agent prompt is clear and well-structured, and the safety constraints (strict: true, read-only permissions, scoped bash tools, close-older-issues, expires: 7d) are solid.
Issue summary
| Severity | Count |
|---|---|
| 💡 Suggestion | 2 |
Positive callouts
- Good constraint design:
strict: true+ read-onlypermissions+ scoped bash tool allowlist keeps the agent's blast radius minimal - Issue lifecycle management:
close-older-issues: true+expires: 7dprevents issue pile-up — at most 1 open issue at a time - Category-specific guidance: The prompt gives focused instructions per scan category, improving the quality of filed issues
- Pipeline safety: All
grep | wc -lpipelines properly guard againstpipefailwith|| true
Generated by Android PR Reviewer for issue #11352 · ● 2.8M
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Adds a nightly agentic workflow (
gh aw) that automatically scans the repo for code quality improvements, files issues, and assigns Copilot (Claude Opus 4.6) to fix them.What it does
Each night, the workflow:
copilotto the issue withclaude-opus-4.6model viaassign-to-agentScan categories
#nullable enableusingdirectivescatchblocksKey design decisions
assign-to-agentsafe-output withmodel: "claude-opus-4.6"to ensure Opus is used (not the default "Auto")close-older-issues: true— each run replaces unfixed issues from previous runsexpires: 7d)max: 1)strict: truewith read-only permissions — the agent cannot modify code directlyFiles
.github/workflows/nightly-fix-finder.md— Workflow source (frontmatter + agent prompt).github/workflows/nightly-fix-finder.lock.yml— Compiled workflow (auto-generated bygh aw compile)