Skip to content

Add multi-agent pipeline: issue-scanner, issue-fixer, pr-verification#663

Merged
YunchuWang merged 2 commits intomainfrom
wangbill/add-copilot-agents
Mar 12, 2026
Merged

Add multi-agent pipeline: issue-scanner, issue-fixer, pr-verification#663
YunchuWang merged 2 commits intomainfrom
wangbill/add-copilot-agents

Conversation

@YunchuWang
Copy link
Copy Markdown
Member

Summary

Adds a three-agent Copilot pipeline modeled after the existing system in durabletask-js, adapted for the .NET SDK.

Architecture

Three collaborative agents are chained in a single GitHub Actions workflow via file-based handoff (JSON context files between sequential steps):

┌─────────────────────┐     /tmp/selected-issue.json     ┌─────────────────────┐     /tmp/pr-info.json     ┌─────────────────────┐
│   Issue Scanner     │ ──────────────────────────────▶  │   Issue Fixer       │ ────────────────────────▶ │   PR Verification   │
│   (Agent 1)         │                                   │   (Agent 2)         │                           │   (Agent 3)         │
└─────────────────────┘                                   └─────────────────────┘                           └─────────────────────┘

Agent 1: Issue Scanner (.github/agents/issue-scanner.agent.md)

  • Fetches the 20 most recent GitHub issues
  • Triages and classifies each issue into categories:
    • triage/actionable, triage/needs-human-verification, triage/known-blocker, triage/requires-redesign, triage/needs-info, triage/already-fixed, triage/too-large, triage/external-dependency, triage/duplicate, triage/feature-request
  • Posts a triage comment on each issue with classification reasoning
  • Selects the single best actionable issue for automated fixing
  • Writes the issue context to /tmp/selected-issue.json for Agent 2
  • If no issue qualifies, writes {\"found\": false} and the pipeline stops

Agent 2: Issue Fixer (.github/agents/issue-fixer.agent.md)

  • Reads the selected issue context from Agent 1
  • Deep-analyzes the codebase (source files, callers, existing tests, adjacent SDKs)
  • Implements a correct, minimal fix following all repository conventions:
    • Copyright headers, XML docs, this. member access, Async suffix, sealed private classes
  • Adds comprehensive tests:
    • Unit tests (xUnit + FluentAssertions + Moq)
    • Integration tests when behavioral changes are involved
  • Runs the full test suite to verify
  • Opens a PR linked to the issue with detailed documentation
  • Writes the PR context to /tmp/pr-info.json for Agent 3

Agent 3: PR Verification (.github/agents/pr-verification.agent.md)

  • Reads the PR context from Agent 2
  • Checks out the PR branch and rebuilds
  • Creates a standalone C# console app that reproduces the customer scenario
  • Runs it against the DTS emulator (started in Docker as part of the workflow)
  • Posts a structured verification report to the linked GitHub issue
  • Updates PR labels (pending-verificationsample-verification-added)
  • Pushes the verification sample to a verification/pr-<N> branch

GitHub Actions Workflow (.github/workflows/auto-issue-fix.yaml)

  • Schedule: Daily at 09:00 UTC (+ manual trigger)
  • Chaining mechanism: Sequential steps with file-based data passing — each agent writes a JSON handoff file that the workflow reads and injects into the next agent's prompt
  • Deduplication: Collects existing copilot-finds PRs/issues before running to prevent duplicate work
  • DTS Emulator: Started in Docker for Agent 3's verification step
  • Labels: Auto-creates copilot-finds, pending-verification, sample-verification-added labels
  • Summary: Posts a pipeline summary to the GitHub Actions step summary

Design Decisions

  1. File-based handoff over built-in handoffs: GitHub Copilot CLI agents don't support built-in handoffs in CI context. Data is passed via JSON files written to /tmp/ and injected into prompts.
  2. Sequential steps in one workflow: More reliable than event-triggered multi-workflow chains — guarantees ordering and shared build context.
  3. Conservative triage: Agent 1 is intentionally conservative — it only selects issues with high confidence of correct automated fixing.
  4. Idempotent verification: Agent 3 checks for existing verification before acting, preventing duplicate work across runs.
  5. Separate verification branches: Verification samples are pushed to verification/pr-<N> branches, keeping main and PR branches clean.

Reference

This system is modeled after the existing multi-agent setup in durabletask-js:

  • daily-code-review.agent.md → split into issue-scanner + issue-fixer for better separation of concerns
  • pr-verification.agent.md → adapted for C#/.NET patterns (xUnit, dotnet build/test, DTS emulator on port 4001)
  • daily-code-review.yaml → evolved into auto-issue-fix.yaml with three-agent chaining

Checklist

  • Agent files follow the chatagent format from the JS repo
  • Workflow uses proper GitHub Actions syntax
  • .NET-specific build/test commands match existing validate-build.yml
  • All agents respect repository coding conventions
  • Deduplication prevents duplicate work
  • DTS emulator integration for PR verification
  • Pipeline summary for visibility

Three collaborative Copilot agents that autonomously:
1. Scan and triage recent GitHub issues (issue-scanner)
2. Fix the selected issue with tests and open a PR (issue-fixer)
3. Verify the PR against the DTS emulator (pr-verification)

Agents are chained in a single GitHub Actions workflow via
file-based handoff (JSON context files between steps).

Modeled after the existing agent system in durabletask-js.
Copilot AI review requested due to automatic review settings March 11, 2026 21:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 scheduled GitHub Actions workflow plus three Copilot “chatagent” prompt files to run a chained automation pipeline (issue triage → automated fix PR → emulator-based verification) for the DurableTask .NET SDK.

Changes:

  • Introduces a daily/manual GitHub Actions workflow to orchestrate three sequential Copilot CLI agent runs with file-based JSON handoff in /tmp/.
  • Adds agent prompt definitions for issue-scanner, issue-fixer, and pr-verification, including guidance for creating and pushing verification samples.
  • Adds repo label bootstrapping and DTS emulator startup/cleanup as part of the workflow.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
.github/workflows/auto-issue-fix.yaml New scheduled workflow chaining three agents, dedup context collection, label creation, and DTS emulator orchestration.
.github/agents/issue-scanner.agent.md New issue triage agent prompt and required JSON handoff contract.
.github/agents/issue-fixer.agent.md New fix implementation agent prompt, testing requirements, PR creation, and PR handoff contract.
.github/agents/pr-verification.agent.md New verification agent prompt describing sample creation, emulator execution, evidence posting, and label updates.

You can also share your feedback on Copilot code review. Take the survey.

Copilot AI review requested due to automatic review settings March 11, 2026 22:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 4 out of 4 changed files in this pull request and generated 9 comments.


You can also share your feedback on Copilot code review. Take the survey.

Code fixes applied:
- Replace --force label creation with ensure_label() function (idempotent)
- Add all triage/* labels (actionable, needs-human-verification, known-blocker,
  requires-redesign, needs-info, already-fixed, too-large, external-dependency,
  duplicate, feature-request)
- Use continue-on-error: true for baseline test step
- Trim dedup context (limit 50, drop file paths from merged PRs)
- Increase job timeout from 60 to 90 minutes
- Use  for project references in verification .csproj example
- Align emulator lifecycle docs (CI vs manual/local runs)

Rejected comments (with reasoning):
- Comment 2: Defaults intentional for verification samples targeting emulator
- Comment 6: CLI version pinning would cause stale tooling; JS repo same pattern
- Comment 14: Model hardcoded intentionally for quality control; fail visibly
- Comment 15: Broad permissions needed; human PR review is the security boundary
@YunchuWang YunchuWang force-pushed the wangbill/add-copilot-agents branch from ff46dc9 to 99d9e25 Compare March 12, 2026 05:14
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.

3 participants