From f37bfa01fe1dca35d3f379d91af5105d36294bc7 Mon Sep 17 00:00:00 2001 From: Hamza Khyari Date: Fri, 8 May 2026 09:21:21 +0000 Subject: [PATCH] feat(agents): add review-started notification to pr-review-worker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Step 0 to both first_review and re_review modes — posts a comment on the PR immediately after parameter validation, before any reading or cloning. Gives the PR author instant visibility that a review is in progress. CI flag mode is unchanged (too lightweight to warrant a notification). ISSUES CLOSED: #11028 --- .opencode/agents/pr-review-worker.md | 24 ++++++++++++++++++++++++ CHANGELOG.md | 6 ++++++ 2 files changed, 30 insertions(+) diff --git a/.opencode/agents/pr-review-worker.md b/.opencode/agents/pr-review-worker.md index aeb40552f..be5ab0acc 100644 --- a/.opencode/agents/pr-review-worker.md +++ b/.opencode/agents/pr-review-worker.md @@ -136,6 +136,18 @@ Entered when `review_type` is `ci_flag`. This is a lightweight review that only Entered when `review_type` is `re_review`. The PR previously received `REQUEST_CHANGES` feedback and the author has since pushed new commits. Your job is to verify the feedback was adequately addressed AND conduct a full review of the current state. +0. **Post review-started notification.** POST `{forgejo_url}/api/v1/repos/{forgejo_owner}/{forgejo_repo}/issues/{pr_number}/comments` with body: + ``` + > Starting review for PR #{pr_number} (`re_review`)... + > + > Previous feedback was addressed — verifying changes and conducting full re-review. This may take a few minutes. + + --- + Automated by CleverAgents Bot + Supervisor: PR Review | Agent: pr-review-worker + ``` + Use authentication: `Authorization: token {forgejo_pat}`. Do NOT wait for a response before continuing — fire and move on. + 1. **Read the PR.** GET `{forgejo_url}/api/v1/repos/{forgejo_owner}/{forgejo_repo}/pulls/{pr_number}` — read title, body, labels, milestone, and linked issues. 2. **Read all linked issues.** Parse `Closes #N`, `Fixes #N`, and `Refs #N` patterns from the PR body. For each referenced issue, GET `{forgejo_url}/api/v1/repos/{forgejo_owner}/{forgejo_repo}/issues/{issue_number}` — read title, body, labels, and acceptance criteria. @@ -176,6 +188,18 @@ Entered when `review_type` is `re_review`. The PR previously received `REQUEST_C Entered when `review_type` is `first_review`. The PR has no active review feedback — this is a fresh evaluation from scratch. +0. **Post review-started notification.** POST `{forgejo_url}/api/v1/repos/{forgejo_owner}/{forgejo_repo}/issues/{pr_number}/comments` with body: + ``` + > Starting review for PR #{pr_number} (`first_review`)... + > + > Conducting fresh evaluation against the full review checklist. This may take a few minutes. + + --- + Automated by CleverAgents Bot + Supervisor: PR Review | Agent: pr-review-worker + ``` + Use authentication: `Authorization: token {forgejo_pat}`. Do NOT wait for a response before continuing — fire and move on. + 1. **Read the PR.** Same as Re-Review Mode step 1. 2. **Read all linked issues.** Same as Re-Review Mode step 2. diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b758fa6f..e570396f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,12 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Added +- **`pr-review-worker` review-started notification** (#11028): The `first_review` + and `re_review` modes now post a "review started" notification comment to the + PR at the beginning of the review, giving PR authors immediate visibility + that a review is in progress. Posted asynchronously so it does not block + the workflow. + - **Plan Rollback Command** (#8557): Implemented `agents plan rollback []` for checkpoint-based plan state restoration in Epic #8493. The command restores a plan's sandbox to the state captured at a given checkpoint, discarding all decisions made after that checkpoint. The checkpoint can be specified as an optional positional second argument or via the `--to-checkpoint` named option. Supports `--yes/-y` flag to skip confirmation prompts and `--format/-f` for output format selection (rich/plain/json/yaml). Included with comprehensive BDD test coverage (>= 97%) and spec-aligned output formatting showing rollback summary, changes reverted, impact analysis, and post-rollback state panels. ### Fixed -- 2.52.0