Pattern quality: Default schedule-triggered issue/PR workflows to include dedupe guard in generated file - #249
Merged
pelikhan merged 1 commit intoSep 2, 2026
Conversation
generateWorkflowFile previously produced the same guidance in prose (via generateAgentPrompt) but never applied skip-if-match / max / expires to the directly generated workflow .md file itself. A schedule-triggered workflow using create-issue or create-pull-request (e.g. status-report, dependency-monitor) would ship with no deduplication guard at all, so every scheduled run creates another duplicate issue/PR forever. This adds a default: when a workflow's triggers include schedule and its safe-outputs include create-issue or create-pull-request, the generated file now includes: - 'skip-if-match' as a sibling of schedule under on: - 'max: 1' and 'expires: 7' under every dedupe-relevant safe-output key Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pelikhan
marked this pull request as ready for review
September 2, 2026 01:52
pelikhan
deleted the
fix/dedupe-guard-generated-workflow-file-0a02c5d3971d1f10
branch
September 2, 2026 01:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Samples evaluated
Reviewed all 6 generated pattern/prompt samples in
/tmp/gh-aw/data/generated-patterns-and-prompts.json(status-report, issue-triage, code-improvement, documentation-updater, dependency-monitor, pr-review), each against itspatterns/archetypes/*.jsonrecommendation andsrc/js/workflow.jsgeneration logic, plus a downstream-agent simulation.Recurring quality issue found
generateWorkflowFile(the function that produces the actual.github/workflows/*.mdfile, used both by the CLI's file-generation mode and as the "Suggested workflow file" draft embedded in everygenerateAgentPromptoutput) never applied deduplication guards to scheduled workflows that create issues or pull requests.The wizard already has correct prose-level guidance for this exact risk —
generateAgentPromptsurfaces "Prevent duplicate scheduled findings" tips and askip-if-match/max/expiresschema example, and existing tests (workflow.test.js) assert this text appears in the prompt. But that guidance only reached the instructions telling an agent how to write the workflow — it was never applied to the workflow file the generator itself emits.Concretely:
status-report(schedule +create-issue) anddependency-monitor(schedule +create-issue/create-pull-request) generated files with noskip-if-matchunderon:and nomax/expiresundersafe-outputs:. Any downstream agent that used the generated file as-is (rather than fully rewriting it per the separate prose tips) would produce a workflow that creates a brand-new duplicate issue/PR on every scheduled run forever — the exact failure mode the pattern library's own tips warn against.What changed
In
src/js/workflow.js,generateWorkflowFilenow defaults to adding the dedupe guard whenever a workflow's triggers includescheduleand its safe-outputs includecreate-issueorcreate-pull-request:skip-if-match: 'is:issue is:open "gh-aw-workflow-id: <name>" in:body'as a sibling ofschedule:underon:.max: 1/expires: 7under every dedupe-relevant safe-output key (not just the first one).Added three new tests: the guard is applied for
status-report(single dedupe output), applied for every dedupe-relevant output ondependency-monitor(bothcreate-issueandcreate-pull-request), and absent for non-scheduled/non-dedupe workflows (issue-triage). Updated one existing test (adds inferred capabilities and optional agent capabilities) whose fixture now also gets the guard since it usesstatus-report+schedule+create-issue.Validation
npm test: 18 test files, 318 tests passed.npm run build: succeeded, no errors.Follow-ups deliberately left out
create-discussion) — left scoped to the two outputs the existing prompt-mode tips already cover, to keep the change minimal and consistent with tested guidance.protected-filesor PR-spam-rate-limit defaults to the generated file (analogous gaps exist forcode-improvement/documentation-updater), since those are separate, lower-confidence findings from this same review and deserve their own focused change.