Proposal: fix ca-pr-self-reviewer — use APPROVED review state instead of COMMENT when approving PRs #3229

Open
opened 2026-04-05 08:04:38 +00:00 by freemo · 2 comments
Owner

Agent Improvement Proposal

Pattern Detected

Type: prompt_improvement
Affected Agent: ca-pr-self-reviewer
Evidence:

The system watchdog (issue #3120, cycle 1 and cycle 6) has flagged a persistent compliance issue:

"PRs continue to be merged with only 1 bot self-review (COMMENT state, not APPROVED). CONTRIBUTING.md requires 2 approving reviews."

Specific evidence from PR #3022 (recently merged):

  • The review posted by ca-pr-self-reviewer has Forgejo API state "COMMENT"
  • But the review body text says "## Review: APPROVED ✅"
  • This means the agent is writing "APPROVED" in the review text but submitting the review with the wrong Forgejo API state parameter

This same pattern was observed on PR #2886 (merged with only 1 COMMENT-state review).

Proposed Change

Add an explicit, unambiguous instruction to the ca-pr-self-reviewer agent prompt that specifies the exact state parameter value to use when calling forgejo_create_pull_review. Currently the prompt says:

"Post an APPROVED review via Forgejo API with a summary of what was reviewed."

This is ambiguous — the agent interprets "APPROVED" as text to include in the review body, not as the API state parameter. The fix would add a concrete code example showing the correct API call:

When approving, you MUST use state: "APPROVED" in the forgejo_create_pull_review call:
  forgejo_create_pull_review(owner, repo, index, state="APPROVED", body="<your review>")

Do NOT use state: "COMMENT" — this does not count as an approval.

Expected Impact

  • PRs will receive proper APPROVED-state reviews, satisfying branch protection approval requirements
  • The watchdog will stop flagging "PRs merged with only COMMENT-state reviews"
  • Review audit trail will correctly reflect approval decisions

Risk Assessment

  • Low risk: This is a clarification of existing intent, not a behavior change. The agent already intends to approve — it's just using the wrong API parameter.
  • Potential downside: None identified. The agent already performs thorough reviews before approving.

This is a proposal from the agent evolver. A human must approve this issue before the change will be implemented. To approve: remove the needs feedback label, add State/Verified, or comment with approval.


Automated by CleverAgents Bot
Supervisor: Agent Evolver | Agent: ca-agent-evolver

## Agent Improvement Proposal ### Pattern Detected **Type**: prompt_improvement **Affected Agent**: ca-pr-self-reviewer **Evidence**: The system watchdog (issue #3120, cycle 1 and cycle 6) has flagged a persistent compliance issue: > "PRs continue to be merged with only 1 bot self-review (COMMENT state, not APPROVED). CONTRIBUTING.md requires 2 approving reviews." Specific evidence from PR #3022 (recently merged): - The review posted by `ca-pr-self-reviewer` has Forgejo API state `"COMMENT"` - But the review body text says `"## Review: APPROVED ✅"` - This means the agent is writing "APPROVED" in the review text but submitting the review with the wrong Forgejo API state parameter This same pattern was observed on PR #2886 (merged with only 1 COMMENT-state review). ### Proposed Change Add an explicit, unambiguous instruction to the `ca-pr-self-reviewer` agent prompt that specifies the exact `state` parameter value to use when calling `forgejo_create_pull_review`. Currently the prompt says: > "Post an **APPROVED** review via Forgejo API with a summary of what was reviewed." This is ambiguous — the agent interprets "APPROVED" as text to include in the review body, not as the API `state` parameter. The fix would add a concrete code example showing the correct API call: ``` When approving, you MUST use state: "APPROVED" in the forgejo_create_pull_review call: forgejo_create_pull_review(owner, repo, index, state="APPROVED", body="<your review>") Do NOT use state: "COMMENT" — this does not count as an approval. ``` ### Expected Impact - PRs will receive proper APPROVED-state reviews, satisfying branch protection approval requirements - The watchdog will stop flagging "PRs merged with only COMMENT-state reviews" - Review audit trail will correctly reflect approval decisions ### Risk Assessment - **Low risk**: This is a clarification of existing intent, not a behavior change. The agent already intends to approve — it's just using the wrong API parameter. - **Potential downside**: None identified. The agent already performs thorough reviews before approving. --- *This is a proposal from the agent evolver. A human must approve this issue before the change will be implemented. To approve: remove the `needs feedback` label, add `State/Verified`, or comment with approval.* --- **Automated by CleverAgents Bot** Supervisor: Agent Evolver | Agent: ca-agent-evolver
Author
Owner

Make sure it does both, it uses the actual approval state as a reviewer you describe, but also leaves a comment. Otherwise I approve this.

Make sure it does both, it uses the actual approval state as a reviewer you describe, but also leaves a comment. Otherwise I approve this.
Author
Owner

Human approval acknowledged with condition. Issue verified and transitioned to State/Verified.

  • State: State/UnverifiedState/Verified
  • Approved by: CTO (human review, conditional)
  • CTO condition: The implementation must ensure the agent does both:
    1. Uses state: "APPROVED" in the forgejo_create_pull_review API call (not "COMMENT")
    2. Also leaves a review comment with the review summary text
  • Next step: This issue is ready for implementation. The implementor must ensure the prompt update instructs the agent to use state="APPROVED" while also including a body parameter with the review text, so both the approval state and the comment are present.

Automated by CleverAgents Bot
Supervisor: Human Liaison | Agent: ca-human-liaison

Human approval acknowledged with condition. Issue verified and transitioned to `State/Verified`. - **State**: `State/Unverified` → `State/Verified` - **Approved by**: CTO (human review, conditional) - **CTO condition**: The implementation must ensure the agent does **both**: 1. Uses `state: "APPROVED"` in the `forgejo_create_pull_review` API call (not `"COMMENT"`) 2. Also leaves a review comment with the review summary text - **Next step**: This issue is ready for implementation. The implementor must ensure the prompt update instructs the agent to use `state="APPROVED"` while also including a `body` parameter with the review text, so both the approval state and the comment are present. --- **Automated by CleverAgents Bot** Supervisor: Human Liaison | Agent: ca-human-liaison
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#3229
No description provided.