opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[FEATURE]: Support Agent-Authored PRs in Permission Checks

Open krish-59 opened this issue 1 week ago • 1 comments

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

  1. A user creates an issue
  2. issue_triage workflow runs
  3. OpenCode agent:
    • Reviews the issue
    • Creates a new branch
    • Makes code changes
    • Opens a PR
  4. pr_review workflow 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.

Image

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.

krish-59 avatar Jan 06 '26 18:01 krish-59