Skip to content

feat: add gateway issue dispatcher workflow#2603

Merged
lpcox merged 1 commit into
mainfrom
feat/gateway-issue-dispatcher
Mar 26, 2026
Merged

feat: add gateway issue dispatcher workflow#2603
lpcox merged 1 commit into
mainfrom
feat/gateway-issue-dispatcher

Conversation

@lpcox

@lpcox lpcox commented Mar 26, 2026

Copy link
Copy Markdown
Collaborator

Adds an agentic workflow that runs every 6 hours to audit open gateway-labeled issues in github/gh-aw and create corresponding tracking issues in github/gh-aw-mcpg with problem analysis and proposed solutions.

What it does

  1. Lists all open issues in github/gh-aw with the gateway label
  2. Skips issues that already have a linked gh-aw-mcpg tracking issue (detected via comment URL)
  3. For each unprocessed issue: analyzes the problem, researches the codebase, and creates a tracking issue in gh-aw-mcpg with problem description, analysis, proposed solution, and testing guidance
  4. Comments on the original gh-aw issue with a link to the new tracking issue

Configuration

  • Schedule: Every 6 hours (fuzzy)
  • Cross-repo access: Uses CROSS_REPO_PAT secret for read/write across both repos
  • Guard policy: min-integrity: none, allowed-repos: [github/gh-aw, github/gh-aw-mcpg]
  • Safe outputs: create-issuegithub/gh-aw-mcpg, add-commentgithub/gh-aw

Prerequisites

Add a CROSS_REPO_PAT repository secret with issues:write + repo:read access to both github/gh-aw and github/gh-aw-mcpg.

Audits open 'gateway'-labeled issues in github/gh-aw every 6 hours,
creates tracking issues in github/gh-aw-mcpg with problem analysis
and proposed solutions, then links the two via a comment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 26, 2026 19:51
@lpcox
lpcox merged commit 4f3ecca into main Mar 26, 2026
11 checks passed
@lpcox
lpcox deleted the feat/gateway-issue-dispatcher branch March 26, 2026 19:54

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 scheduled agentic workflow that periodically audits gateway-labeled issues in github/gh-aw and creates linked tracking issues in github/gh-aw-mcpg via safe-outputs.

Changes:

  • Introduces a new workflow prompt (.md) describing the audit/filter/create/link procedure and safe-output constraints.
  • Adds the compiled/locked GitHub Actions workflow (.lock.yml) to run on a 6-hour scattered schedule with MCP + safe-outputs wiring.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/gateway-issue-dispatcher.md Defines the agent procedure, tool access, and safe-output limits for cross-repo issue triage + tracking issue creation.
.github/workflows/gateway-issue-dispatcher.lock.yml Generated locked workflow implementing the scheduled Copilot/AWF run with MCP gateway and safe-outputs execution.

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

Comment on lines +49 to +66
```bash
gh issue list --repo github/gh-aw --label gateway --state open --json number,title,body,url,labels,createdAt --limit 100
```

If there are no open gateway issues, report "No open gateway issues found" and
stop.

### Step 2: Filter Already-Processed Issues

For each gateway issue, check its comments for an existing link to a
`github/gh-aw-mcpg` issue. An issue is already processed if any comment
contains a URL matching `github.com/github/gh-aw-mcpg/issues/`.

```bash
# For each issue number, check comments
gh issue view <NUMBER> --repo github/gh-aw --json comments --jq '.comments[].body' \
| grep -q 'github.com/github/gh-aw-mcpg/issues/' && echo "SKIP" || echo "PROCESS"
```

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

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

The prompt relies on gh issue list/view commands, but this workflow doesn’t set GH_TOKEN (or otherwise ensure gh is authenticated) in the agent runtime. This can cause the dispatcher to fail at Step 1/2. Prefer using the configured GitHub MCP issues tools for listing issues and reading comments, or add an explicit mechanism to authenticate gh with the intended cross-repo token in the agent environment.

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +30
safe-outputs:
github-token: ${{ secrets.CROSS_REPO_PAT }}
max-bot-mentions: 1
create-issue:
max: 10
target-repo: "github/gh-aw-mcpg"
labels: [gateway, from-gh-aw]
add-comment:
max: 10
target: "*"
target-repo: "github/gh-aw"

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

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

safe-outputs limits both create-issue and add-comment to max: 10, but the procedure says to process each unprocessed gateway issue (and Step 1 fetches up to 100). If there are >10 unprocessed issues, the run will be unable to complete as described. Either cap processing to the 10 oldest unprocessed issues in the instructions, or raise the safe-output limits accordingly.

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +21
github-token: ${{ secrets.CROSS_REPO_PAT }}
allowed-repos: ["github/gh-aw", "github/gh-aw-mcpg"]
min-integrity: none
bash: true

safe-outputs:
github-token: ${{ secrets.CROSS_REPO_PAT }}

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

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

The same CROSS_REPO_PAT secret is used for both read-only GitHub MCP access and for write operations via safe-outputs. Even though the MCP server is configured as read-only, using a write-scoped PAT here increases blast radius if any enforcement is bypassed. Consider splitting this into separate secrets (read-only for MCP queries, write-only for safe-outputs) with least-privilege scopes.

Suggested change
github-token: ${{ secrets.CROSS_REPO_PAT }}
allowed-repos: ["github/gh-aw", "github/gh-aw-mcpg"]
min-integrity: none
bash: true
safe-outputs:
github-token: ${{ secrets.CROSS_REPO_PAT }}
github-token: ${{ secrets.CROSS_REPO_PAT_READ }}
allowed-repos: ["github/gh-aw", "github/gh-aw-mcpg"]
min-integrity: none
bash: true
safe-outputs:
github-token: ${{ secrets.CROSS_REPO_PAT_WRITE }}

Copilot uses AI. Check for mistakes.
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.

2 participants