Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Automated workflow to detect duplicate issues with scheduled batch processing for cost control. Agent operates with read-only permissions.

Implementation

  • Workflow: .github/workflows/issue-duplication-detector.md + compiled .lock.yml
  • Triggers: schedule: cron: "*/5 * * * *" (every 5 minutes) + workflow_dispatch
  • Permissions: Agent job has read-all only
  • Tools: GitHub API with default toolsets for issue search/retrieval, bash with full command access
  • Safe Outputs: add-comment (max: 10) handles write operations in isolated job

Behavior

  1. Runs every 5 minutes to batch-process recently updated issues (last 10 minutes)
  2. For each recent issue, searches repository for semantic duplicates using keywords from title/body
  3. Posts comment only when high confidence duplicates found:
    • Lists duplicate issue numbers with links
    • Explains similarity
    • Suggests next steps (review existing issue, add context, close)
  4. Silent when no duplicates detected

Cost Control & Security

  • Batch Processing: Maximum 12 runs per hour provides guaranteed upper bound on costs
  • Abuse Prevention: Schedule-based triggering prevents unbounded workflow executions from malicious issue creation
  • Natural Batching: Multiple issues processed in single run for efficiency
  • Security Model: Agent cannot modify issues. Write operations delegated to safe_outputs job with scoped issues: write permission, executing after agent completion.

Custom agent used: create-agentic-workflow
Design agentic workflows using GitHub Agentic Workflows (gh-aw) extension with interactive guidance on triggers, tools, and security best practices.

Original prompt

Create an agentic workflow to detect issue duplication. If detected, comment on the issue that was duplicated and suggest next step. Do not modify issues and do not allow agent to have write permissions.

Custom agent used: create-agentic-workflow
Design agentic workflows using GitHub Agentic Workflows (gh-aw) extension with interactive guidance on triggers, tools, and security best practices.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add agentic workflow for issue duplication detection Add issue duplication detector agentic workflow Jan 16, 2026
Copilot AI requested a review from Mossaka January 16, 2026 19:22
@Mossaka
Copy link
Collaborator

Mossaka commented Jan 16, 2026

@copilot

Note that responding to every issue with an agentic workflows creates an unbounded $$$ spent that could be abused. If you can batch the analyzis in sets of 5 minutes windows, you get a guaranteed upper bound on $$$ and also natural batching of requests.

Copy link
Contributor Author

Copilot AI commented Jan 16, 2026

@copilot

Note that responding to every issue with an agentic workflows creates an unbounded $$$ spent that could be abused. If you can batch the analyzis in sets of 5 minutes windows, you get a guara...

Changed to batch processing with a 5-minute scheduled window. The workflow now:

  • Runs every 5 minutes via cron schedule instead of on every issue event
  • Processes all issues updated in the last 10 minutes in a single batch
  • Limits cost to at most 12 runs per hour with natural batching
  • Increased max comment limit to 10 to handle multiple issues per batch

Commit: 4c6d0bf

Copilot AI changed the title Add issue duplication detector agentic workflow Add issue duplication detector agentic workflow with batch processing Jan 16, 2026
Copy link
Collaborator

@Mossaka Mossaka left a comment

Choose a reason for hiding this comment

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

@copilot allow all bash tools

Copy link
Contributor Author

Copilot AI commented Jan 16, 2026

@copilot allow all bash tools

Changed bash tool from "date *" to "*" to allow all bash commands.

Commit: 4eee925

Copilot AI requested a review from Mossaka January 16, 2026 19:33
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