factory: App cannot submit APPROVED review on PRs it authored, so approved PRs sit at CHANGES_REQUESTED
Describe the Bug
The Factory GitHub App authors the pull request, so GitHub rejects an APPROVE review from the same App identity (authors cannot approve their own PRs). The Factory's own re-review comment says so explicitly: "GitHub rejected the approval review because the authenticated app authored the PR". It then falls back to a comment plus the status:auto-approved label.
Result: once any CHANGES_REQUESTED review exists on the PR (for example the human relay described in the companion issue), reviewDecision stays CHANGES_REQUESTED forever from the Factory's side. The Factory shows the work item as Done on its Work and Review boards while GitHub shows the PR blocked. Operators see PRs "stuck after approval" and must submit a non-author APPROVED review by hand.
Observed on every reviewed PR during a pilot (5 PRs, 0.15.1-alpha.0 and 0.16.0-alpha.6).
Steps To Reproduce
- Install the Factory GitHub App; let it open a PR and review it.
- Submit a formal
CHANGES_REQUESTEDreview as a human (or have any such review exist). - Let the Factory repair and re-review to
approve. - Observe: comment +
status:auto-approvedlabel;reviewDecisionstillCHANGES_REQUESTED; Factory boards show Done.
Link to Minimal Reproducible Example
Private repo; exact comment text and timestamps available on request.
Expected Behavior
One of:
- Reviews submitted under a distinct reviewer identity (separate App installation or a configurable reviewer token) so
APPROVEis accepted, or - The Factory dismisses its own stale
REQUEST_CHANGESreview and/or documents clearly that a non-author approval is required, and reflects "awaiting human approval" on the board instead of Done.
Environment Information
- @mastra/factory: 0.15.1-alpha.0 and 0.16.0-alpha.6
- @mastra/core: 1.68.0-alpha.0 / 1.68.0-alpha.6
- Node: 22.23.1, Linux (self-hosted, systemd)
- LLM Provider: multiple
- GitHub: GitHub App integration, org-scoped Work Intake
Verification
- I have searched the existing issues to make sure this is not a duplicate
- I have included sufficient information for the team to reproduce and understand the issue
Source: mastra-ai/mastra