feat(workflows): reusable review-dispatch workflow + consumer template - #160
Merged
Conversation
Closes part of #117. Centralizes the review-request-dispatch logic that each consumer repo currently duplicates (henry/, jack/, alex/, ai-mktpl/). `.github/workflows/review-dispatch.yaml` — `workflow_call`-callable workflow that handles `pull_request` `labeled` events, validates the `request-review` label, and dispatches to the configured reviewer agent's repo via `repository_dispatch`. `templates/dispatch-review.yaml` — single-file template each consumer repo drops into `.github/workflows/dispatch-review.yaml` and `uses:` nsheaps/agents/.github/workflows/review-dispatch.yaml@main. Migration plan: - This PR adds the reusable workflow + template, no consumer switched yet. - Follow-up #123 migrates Henry's own dispatch setup. - Follow-up #124 adds dispatch-review.yaml to alex, jack, agents, ai-mktpl. Co-Authored-By: Agent Alex Picard <alex-nsheaps[bot]@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Review: Correctness 95% | Security 90% | Simplicity 92% | Confidence 94%
PR Contents ✅
Title 68 chars, conventional commit, links issue #117. Body has migration plan (this PR → #123 Henry migration → #124 4-repo rollout) and documents the three design decisions resolved before coding. Test plan present.
Commit ✅
Single focused commit with a detailed body matching the PR description.
Diff ✅
Two new files only — review-dispatch.yaml (reusable) + templates/dispatch-review.yaml (consumer drop-in). No unrelated changes.
Code
.github/workflows/review-dispatch.yaml
ifgate on the job correctly covers all three cases: always-dispatch-on-draft flag, non-draft PRs (dispatches on all relevant events), draft PRs with explicitrequest-reviewlabel. ✓concurrencygroup per PR number withcancel-in-progress: false— waits rather than cancels, preventing races on rapid pushes. ✓actions/create-github-app-token@v2withowner:scope: token covers both consumer repo (label removal) and target agent repo (dispatch). Broader than strictly necessary but a reasonable trade-off vs. two separate token calls. ✓toJson(github.event.label.name || '')— correctly produces""for non-label events,"request-review"for label events. ✓peter-evans/repository-dispatch@v4payload includes referer, source (repo/PR/SHA/refs), and trigger (event/action/label). Sufficient for the receiver to reconstruct context. ✓
templates/dispatch-review.yaml
secrets: inheritcorrectly passesREVIEW_GITHUB_APP_ID/REVIEW_GITHUB_APP_PRIVATE_KEYfrom the consumer. ✓@mainref on theuses:— accepts rolling updates from the reusable workflow, which is appropriate for an internal fleet where you own all consumers. ✓- PR event types
[opened, synchronize, ready_for_review, labeled]match existing review trigger convention. ✓
Follow-ups (non-blocking):
- P2: Token uses
owner:-level scope rather than per-repo — acceptable for this internal use case but worth narrowing if the App's installation scope is ever widened - P2:
@mainpin — fine here, but consumers should be aware that changes to the reusable workflow propagate immediately with no version gate - P2: Labels still not applied (pattern continues from #159)
🤖 Henry Oldenburg — automated review · nsheaps/.ai-agent-henry
alex-nsheaps Bot
added a commit
that referenced
this pull request
May 22, 2026
Per Nate [17:01Z](https://discord.com/channels/1490863845252665415/1497431286661517353/1507428091616694393): "keep [the spec] up to date with references to where things are implemented and sources used for research (and links to research docs)." Changes: 1. New "Implementation map" table under §Status with section → file links. 2. Open-questions section: each Q1-Q6 now carries a "Current implementation:" line; Q5 (metrics schema versioning) marked RESOLVED with v1 schema. 3. Phases section: rebuilt to mark phases 1-6 complete with commit shas; phases 7-9 marked ⏳ as henry-companion-PR / e2e follow-ups. 4. "Footnote" → "Sources / research links": adds all the Discord-msg refs that drove the spec + cross-links to PR #164, PR #160, and the adjacent deprecated-agent spec. Co-Authored-By: Agent Alex Picard <alex-nsheaps[bot]@users.noreply.github.com>
alex-nsheaps Bot
added a commit
that referenced
this pull request
May 29, 2026
Per Nate [17:01Z](https://discord.com/channels/1490863845252665415/1497431286661517353/1507428091616694393): "keep [the spec] up to date with references to where things are implemented and sources used for research (and links to research docs)." Changes: 1. New "Implementation map" table under §Status with section → file links. 2. Open-questions section: each Q1-Q6 now carries a "Current implementation:" line; Q5 (metrics schema versioning) marked RESOLVED with v1 schema. 3. Phases section: rebuilt to mark phases 1-6 complete with commit shas; phases 7-9 marked ⏳ as henry-companion-PR / e2e follow-ups. 4. "Footnote" → "Sources / research links": adds all the Discord-msg refs that drove the spec + cross-links to PR #164, PR #160, and the adjacent deprecated-agent spec. Co-Authored-By: Agent Alex Picard <alex-nsheaps[bot]@users.noreply.github.com>
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.
Summary
Closes part of #117. Centralizes the review-request-dispatch logic that each consumer repo currently duplicates.
.github/workflows/review-dispatch.yaml—workflow_call-callable workflow that handlespull_requestlabeledevents, validates therequest-reviewlabel, and dispatches to the configured reviewer agent's repo viarepository_dispatch.templates/dispatch-review.yaml— single-file template each consumer repo drops into.github/workflows/dispatch-review.yamlanduses:nsheaps/agents/.github/workflows/review-dispatch.yaml@main.Migration plan
dispatch-review.yamlto nsheaps/.ai-agent-alex, nsheaps/.ai-agent-jack, nsheaps/agents, nsheaps/ai-mktpl.Design context
Three open questions resolved before this PR (see prior design doc work tracked in #247, #248):
inputs.reviewer-repo(nsheaps/<reviewer-agent-repo>) +inputs.reviewer-event-type(matches the reviewer'son.repository_dispatch.typesfilter).secrets.AUTOMATION_GITHUB_APP_TOKENfor cross-repo dispatch; the secret is already synced to all agent repos via nsheaps/.github#53.label.name == 'request-review'so other labels (e.g.automerge) don't fan out.Test plan
gh workflow run --dryuses:this workflow, verifies dispatch still fires end-to-end.