Add title-based deduplication to create_issue safe outputs (MCP + apply-time)#32655
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds title-based deduplication for create_issue safe outputs so duplicate tool calls (same/near-same title) are dropped before creating duplicate issues, with enforcement both at MCP tool-call time and at apply time.
Changes:
- Introduces
deduplicate-by-titleconfiguration (boolean exact-match or integer Levenshtein threshold) in schema + TS types. - Adds a small dedup engine (
levenshtein_distance.cjs,issue_title_dedup.cjs) and wires an MCPcreate_issuehandler for within-run dedup feedback. - Extends apply-time
create_issueto enforce within-run and repo-level dedup, and updates step summary rendering + tests.
Show a summary per file
| File | Description |
|---|---|
| pkg/parser/schemas/main_workflow_schema.json | Adds deduplicate-by-title to workflow schema for create-issue. |
| actions/setup/js/types/safe-outputs-config.d.ts | Exposes deduplicate-by-title in safe-outputs TS types. |
| actions/setup/js/safe_outputs_tools_loader.cjs | Wires create_issue to a dedicated MCP handler. |
| actions/setup/js/safe_outputs_tools_loader.test.cjs | Adds coverage for create_issue handler attachment. |
| actions/setup/js/safe_outputs_handlers.cjs | Implements MCP pre-check within-run title dedup for create_issue. |
| actions/setup/js/safe_outputs_handlers.test.cjs | Adds tests for MCP pre-check dedup behavior and config validation. |
| actions/setup/js/levenshtein_distance.cjs | Adds Levenshtein distance utility. |
| actions/setup/js/levenshtein_distance.test.cjs | Adds unit tests for Levenshtein implementation. |
| actions/setup/js/issue_title_dedup.cjs | Adds config parsing, normalization, and duplicate matching helper. |
| actions/setup/js/create_issue.cjs | Enforces dedup at apply-time (within-run + repo-level) with structured dropped results. |
| actions/setup/js/create_issue.test.cjs | Adds tests for apply-time dedup behavior and config validation. |
| actions/setup/js/safe_output_summary.cjs | Renders “Duplicate Dropped” outcomes with details in step summary. |
| actions/setup/js/safe_output_summary.test.cjs | Adds summary test coverage for dropped duplicate outcomes. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 12/13 changed files
- Comments generated: 2
| /** | ||
| * Search for existing issues that are potential title-duplicates. | ||
| * Includes all open issues and recently closed issues. | ||
| * |
| const [openIssues, recentlyClosedIssues] = await Promise.all([ | ||
| githubClient.rest.search.issuesAndPullRequests({ | ||
| q: `repo:${owner}/${repo} is:issue is:open`, | ||
| per_page: 100, | ||
| sort: "updated", |
|
@copilot review all comments. Fix https://github.com/github/gh-aw/actions/runs/25967498263/job/76333469009#step:7:1 |
|
|
… test Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in
Validation run:
|
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in
|
Implemented in This enables |
This reverts commit 34afb06. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
|
|
@copilot Remove all automatic rollout code. This should not have been implemented. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in Removed all automatic rollout code for |
|
@copilot Enable the deduplicate flag on selected agentic-workflows in this repository, then recompile, merge into main, and recompile again. |
I can do this, but I need two specifics before I apply changes:
|
Adds reference documentation for the new safe-outputs.create-issue.deduplicate-by-title field (true for exact match, integer for Levenshtein edit distance) introduced in #32655. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Agents were emitting duplicate
create_issuemessages with the same title in a single run, and prompt-level controls were not reliable. This change adds handler-level title deduplication so duplicates are dropped before duplicate issues are created.Config + schema
safe-outputs.create-issue.deduplicate-by-title.true→ exact normalized title matchN(0–100) → Levenshtein distance thresholdpkg/parser/schemas/main_workflow_schema.jsonactions/setup/js/types/safe-outputs-config.d.tsDedup engine (new focused modules)
actions/setup/js/levenshtein_distance.cjs(with full unit tests).actions/setup/js/issue_title_dedup.cjsfor:MCP pre-check (immediate feedback)
create_issueMCP handler insafe_outputs_handlers.cjs.duplicate_droppedto the agent immediatelysafe_outputs_tools_loader.cjs.Apply-time enforcement (authoritative safety net)
create_issue.cjsto enforce dedup before issue creation:dropped_duplicatededup_source(mcp-precheck/within-run/repo-level)Step summary rendering
safe_output_summary.cjsto render dropped duplicate outcomes with clear status and dedup details (matched title, distance, source).Tests