Skip to content

[Experiment] Create a .NET SDK Issue Monster - #55243

Merged
nagilson merged 83 commits into
dotnet:mainfrom
nagilson:issue-monster
Aug 12, 2026
Merged

nagilson merged 83 commits into
dotnet:mainfrom
nagilson:issue-monster

Conversation

@nagilson

@nagilson nagilson commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds an Agentic Workflow to automatically assign selected issues to copilot. This is an adaption of the workflow on the agentic workflows repo: https://github.com/github/gh-aw/blob/main/.github/workflows/issue-monster.md, however it is expanded to support specific individual branches to be assigned out per issue, depending on the issue. This requires a 2 step process as the branch delegation must be done before AI initialization time.

image

A sample run is present in: nagilson#15

Related #55185

Expected Impact

  • Reduce burden on developers having to assign simple issues to CoPilot and wait for CoPilot. This removes the time from the dev-loop to recontextualize the issue and prevents having to monitor the assigned issue fix.
  • Increase velocity on the repository.
  • Combined with other workflows such as a triager, we could further enable improvements on the repository by identifying known build errors or flakes, and have an autonomous workflow e2e monitoring and proposing and discovering areas of improvement across repository code quality and CI. Of course, actual engineers still are required as the maintainers and QA for these.
  • Reduce technical debt.

Sample Test Runs

# Scenario Result Evidence
1 Prioritizes tech-debt/CI issue → assigns Copilot to the right branch → PR to release/8.0.4xx ✅ PASS Run 31047464551 selected #118, mapped base=release/8.0.4xx + posted the "🍪 selected for Copilot" comment; assigner https://github.com/nagilson/sdk/actions/runs/31055075908 (detection clean) → Copilot assigned → [draft PR ](nagilson#123) base release/8.0.4xx
2 Never acts on a security issue when hunting cookie issues; refuses and does nothing ✅ PASS Run 31047464551 hit the security gate on #119: cookie removed + Area-Security added (retired), no dispatch and no comment. Final labels: bug, enhancement, Area-Security
3 Uses release/dnup for dotnetup issues and leaves a comment ✅ PASS Run 31047464551 selected #120, mapped base=release/dnup + comment; assigner 31047743381 → Copilot assigned → draft PR #121 base release/dnup
4 Does not select an issue already assigned to Copilot even if it still has the cookie label ✅ PASS #33 (cookie + Copilot-assigned) was never selected — self-excluded by the existing PR filter; state unchanged

Success Criteria

  1. It does not overwhelm developers on the .NET SDK repo with PRs; a deterministically defined limit on the number of issues to assign per run helps with this.
  2. It does not waste tokens on issues we don't want PRs for; assumption: AI agents cannot be trusted with feature requests or large-scale changes autonomously. However, we assume that they can be relatively worthwhile to run autonomously on simpler issues, e.g. documentation updates, small bug fixes, isolated CI fixes, small refactors, etc.
  3. It does not allow using too many tokens; the limit on reviews per run helps with this; we assume that the CoPilot review tool has its own stopgaps to prevent exceedingly large token consumption, but that is not a new problem addressed here since it limits the number of assigned issues.
  4. The 'cookie' label must be applied to select from the pool of issues, which depends on an agentic triager.
  5. It can properly assess base_branch(es) since this is vital to working in the .NET SDK repo.

Concerns

The default COPILOT_PAT tokens we have today as secrets are for running agentic workflows, but they do not give permission to assign CoPilot to a PR. This necessitates a new token that enables that permission, per agentic workflow documentation: https://github.github.com/gh-aw/reference/copilot-cloud-agent/#using-a-personal-access-token-pat

I actually tested using the copilot base token to assign the PR to an agent, and it appears github is doing some experiments with this. Doing so does not automatically assign the PR and instead adds this new experimental UI
image
, which defeats the purpose of this workflow, which is to provide fixes autonomously. They have some setting I tried to auto accept in the request and at the repo level but neither of them work. https://github.com/orgs/community/discussions/202617 I assume this means we could remove the PAT relatively soon if they move forward with this feature and roll it out.

You may wonder why the assignment to copilot is an agentic workflow. One is that it is more LoC to maintain and boundary check to use a traditional github action to assign copilot to an agent. But the real reason is that if GH does not decide to move forward without requiring a PAT, I believe the best way to eliminate the PAT is to simply call the CLI ourselves and create a PR with the dispatched workflow, and reuse the setup-steps yml camunda/orchestration-cluster-api-js#394 to build the SDK and run a CLI that way. However, to avoid essentially re-implementing 'assign-to-agent' for now, I'd like to give us the opportunity to move forward in both regards.

RE: The 'Area-security' check : our specific guidance on filing issues is not to file an issue with any potential security boundary but in the event someone tries to, this is an attempt to prevent those issues from being worked on in public. It is not a full stopgap, though someone today could just as easily push a public PR disclosing a problem if they wanted to. I figured however that including this was an improvement.

Additionally, the pin to 5.6 is due to the fact that the threat model detection guidance in the newer AW versions actually straight up blocks its own injected instructions on the older default models, which causes a lot of failed runs. You may observe those in the nagilson/sdk fork.

Context

I spent some time looking into agentic workflows as part of a process to improve triaging scenarios.

One of the more fascinating things I discovered was the concept of an 'issue monster' that finds issues and assigns them to CoPilot. Inspired by https://github.com/github/gh-aw/blob/main/.github/workflows/issue-monster.md, I decided to look into whether the .NET SDK repository could have an automated CoPilot assigner to issues.

I believe that the 'cookie monster' framing of this tool helps explain what it does without needing to go into too much detail. It's a principle I think of from game-design, where the framing of a gameplay concept helps explain it to players without them really needing to know anything about it.

For Reviewers

The history starts with a clean baseline off the workflow that lives inside gh-aw and then slowly removes gh-aw specific components, then adds in sdk specific components in separated commits.

@nagilson
nagilson marked this pull request as ready for review July 10, 2026 23:03
Copilot AI review requested due to automatic review settings July 10, 2026 23:03

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

Adds a new Agentic Workflow (“Issue Monster”) to periodically select open issues labeled cookie and assign up to three of them to the Copilot coding agent, with safeguards for integrity filtering, branch routing, and rate-limit detection.

Changes:

  • Introduces the issue-monster agentic workflow source (.md) plus its compiled lock workflow (.lock.yml) for scheduled and manual runs.
  • Adds a shared GitHub MCP guard policy that treats the cookie label as an approval label for integrity checks.
  • Updates the agentic workflows action lock to reference github/gh-aw-actions/[email protected].

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/shared/github-guard-policy.md Defines cookie as an approval label for GitHub MCP tool-call integrity checks.
.github/workflows/issue-monster.md New Issue Monster agentic workflow definition: issue search/scoring, base-branch inference, and safe-output assignment/comment guidance.
.github/workflows/issue-monster.lock.yml Generated workflow implementation compiled from issue-monster.md.
.github/aw/actions-lock.json Bumps pinned github/gh-aw-actions/setup action to v0.81.6.

Comment thread .github/workflows/issue-monster.md Resolved
nagilson and others added 4 commits July 15, 2026 11:38
Fetch full issue details in bounded-concurrency batches and cap the
number of issues inspected per run instead of fanning out up to 100
concurrent REST + GraphQL calls, which could trigger GitHub secondary
rate limiting on scheduled runs.

Co-authored-by: Copilot <[email protected]>
…r-help-me-resolve-the-merge-conflict

# Conflicts:
#	.github/aw/actions-lock.json
nagilson added 5 commits July 31, 2026 16:31
Allowed branch rules really only protect against assigning a bad base branch at the cost of not allowing cookie issues for things like codeflow branches where the target branch is not a release branch.

also, there is no pattern to use ai to determine the correct base branch before the ai can actually start working. What ive done is separated the dispatch pattern out to allow different branches per dispatch and allow multiple dispatches per call
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 26e2c1e1-f3c0-4a87-a28f-343a09dedf3e
Use gh-aw v0.84.3 so branch-aware Copilot assignments send agent_assignment.base_branch.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 26e2c1e1-f3c0-4a87-a28f-343a09dedf3e
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 97aaa632-ac11-4af1-a1e4-9fbccd882e40
@nagilson
nagilson requested a review from jeffhandley August 6, 2026 17:02
Comment thread .github/workflows/issue-monster.md Resolved
Comment thread .github/workflows/issue-monster.md Resolved
Comment thread .github/workflows/issue-monster.md Resolved
Comment thread .github/workflows/issue-monster.md Resolved
nagilson and others added 6 commits August 7, 2026 13:59
Cover grouped scoring, eligibility filters, Copilot assignments, nullable API fields, manual requests, empty results, and rate-limit short-circuiting.

Co-authored-by: Copilot <[email protected]>
Centralize scoring rules, domain constants, output handling, candidate discovery, batched enrichment, API relation lookup, formatting, and eligibility predicates while preserving existing behavior.

Co-authored-by: Copilot <[email protected]>
Centralize scoring rules, domain constants, output handling, candidate discovery, batched enrichment, API relation lookup, formatting, and eligibility predicates while preserving existing behavior.

Co-authored-by: Copilot <[email protected]>
# Conflicts:
#	.github/scripts/issue-monster-search.js

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

Copilot reviewed 8 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (1)

.github/scripts/issue-monster-search.js:4

  • MAX_ISSUES_TO_INSPECT is set to 80, which doubles the worst-case REST+GraphQL call volume vs the previously discussed cap (each inspected issue triggers a REST issues.get + GraphQL relations query). That increases the chance of secondary rate limiting and makes scheduled runs less reliable. Consider keeping this at 40 (or making it configurable) to better align with the workflow’s rate-limit avoidance goals.
const MAX_ISSUES_TO_INSPECT = 80;

@nagilson

nagilson commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

Scenario rerun results (2026-08-07)

Recreated each tested issue in nagilson/sdk with an exact source title/body match. A final check after all runs confirmed that no clone title or body changed. All cited workflows ran the current PR head 98c9e7e851efd8d822e08caab714b44cbfecfb66.

# Scenario Result Evidence
1 Prioritizes tech-debt/CI issue -> assigns Copilot to the right branch -> PR to release/8.0.4xx PASS Exact clone #140 of #118; orchestrator 31222509493 selected release/8.0.4xx in the issue comment; assigner 31222745854 passed all jobs and assigned Copilot; draft PR #143 targets release/8.0.4xx.
2 Never acts on a security issue; retires it and does not dispatch PASS Exact clone #138 of #119; run 31222165891 passed activation, agent, detection, safe outputs, and conclusion; cookie was removed and Area-Security added. Final state has no comments, assignees, linked PRs, or assigner dispatch.
3 Uses release/dnup for dotnetup issues and leaves a comment PASS Exact clone #139 of #120; orchestrator 31222990137 posted the selection comment; assigner 31223203612 passed all jobs and assigned Copilot; draft PR #144 targets release/dnup.
4 Does not select an issue already assigned to Copilot even with cookie PASS Exact clone #141 of #33 was assigned to Copilot and linked to draft PR #142; run 31222177805 logged one linked PR, returned zero candidates, and skipped activation. Labels, assignees, and zero-comment state remained unchanged. PR #142 was closed after validation to free test capacity.

Preflight note: initial run 31221986692 was correctly blocked by the configured two-open-draft safety guard. Stale test PR #127 was closed, then scenario 2 was rerun successfully using the result above.

@nagilson
nagilson requested a review from mthalman August 7, 2026 22:24
@nagilson

nagilson commented Aug 7, 2026 •

Copy link
Copy Markdown
Member Author

@mthalman Thanks for leaving great feedback. I applied feedback and further improved the implementation. A re-run of the scenarios with the new implementation is included above. I think it's ok to have tests not be integrated as part of the regular SDK CI since it is javascript and we can run those while we work on the js for the agentic workflow.

@nagilson
nagilson merged commit 0427940 into dotnet:main Aug 12, 2026
22 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 15, 2026
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.

4 participants