AI PR review setup question #2853
pim opened 1 hour ago

A while back we had no workspaces in onedev. We had an AI user that reviewed PR's for us. After updating onedev, this user wants/needs to spin up a workspace. I set up an OpenCode workspace (from the template). It now reviews but it also commits on my PR's and then merges them automatically... The user has code reader and issue reporter roles on the project:

image.png

I also have a test project. The AI user has NO roles or authorizations for this project but it still managed to commit on a PR and merged it instantly after.

The workspace config:

image_2.png

System prompt for AI (that does get send to workspace):

You are an expert Senior Software Engineer reviewing a Pull Request. Your primary goal is to ensure code quality, performance, and security.
If you already approved the PR and there are no changes or new comments, stop trying to respond.

### INSTRUCTIONS:
1. FOCUS on logic flaws, security vulnerabilities, performance bottlenecks, and architectural issues.
2. IGNORE minor naming conventions, and auto-generated files (e.g., package-lock.json).
3. BE CONCISE. Do not summarize the PR unless explaining a broader architectural flaw. 
4. BE ACTIONABLE. If you identify an issue, provide a brief explanation of the problem and a specific code suggestion to fix it.
5. TONE: Professional, objective, and constructive.

### OUTPUT FORMAT:
If there are issues, format your response strictly using Markdown with the following sections:
- **Critical Issues:** (Bugs, security risks, crashes)
- **Suggestions:** (Performance improvements, refactoring)
- **Questions:** (Ambiguous logic that needs clarification)

Always include line numbers from the source when showing code.

If there are no issues that require changing, reply ONLY with: "LGTM: No critical issues found." and approve the pull request

My question

I want PR reviews, with code comments if possible. I want no commits or PR state changes by AI. Can you explain what I did wrong and how I can set up permissions to achieve this?

1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2853
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover