[FEATURE]: Support Agent-Authored PRs in Permission Checks
Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
🚀 Feature Request: Support Agent-Authored PRs in Permission Checks
Summary
I’m building a fully agentic development workflow using OpenCode, where agents autonomously triage issues, modify code, and open pull requests. Currently, this flow breaks when downstream PR review workflows fail due to permission checks on agent activity.
Current Flow
- A user creates an issue
-
issue_triageworkflow runs - OpenCode agent:
- Reviews the issue
- Creates a new branch
- Makes code changes
- Opens a PR
-
pr_reviewworkflow triggers on PR open
Problem
The pr_review workflow performs an assertPermissions check.
Since the last PR activity is from the OpenCode agent, which does not have admin/write permissions, the workflow fails.
This stops the automation until a human manually re-triggers the workflow (e.g., toggling Draft → Ready for Review).
This manual step breaks the goal of a true agentic workflow.
Expected Behavior
Agent-created PRs should be able to:
- Trigger PR review workflows
- Pass permission checks
- Run end-to-end without requiring human intervention
Proposed Solution (Preferred)
Enhance assertPermissions to recognize and allow trusted OpenCode agent activity, enabling PR review workflows to proceed even when the last actor is an agent.
This would unlock fully autonomous issue → PR → review pipelines.
Alternative (Less Preferred)
Allow agents to create draft PRs by default, requiring a human to mark them as “Ready for Review” to trigger the review workflow.
While this works, it still requires manual intervention and limits true autonomy.
Why This Matters
Without this capability, OpenCode cannot fully support:
- End-to-end agentic development
- Autonomous refactoring or maintenance workflows
- Multi-agent CI/CD pipelines
Supporting agent-authored PRs as first-class contributors would significantly enhance OpenCode’s agentic development capabilities.