feat(pr-review): progress comment + session link in review body#267
feat(pr-review): progress comment + session link in review body#267all-hands-bot wants to merge 2 commits into
Conversation
Adds a _SESSION_LINK_SECTION template and session_url parameter. When a session URL is provided and collect_feedback is False, the agent is instructed to include an attribution line linking to the session at the end of the review body. Co-authored-by: openhands <openhands@all-hands.dev>
- get_session_url(): auto-detects GitHub Actions (GITHUB_RUN_ID) or OpenHands Cloud Automation (SANDBOX_ID + OPENHANDS_CLOUD_API_URL); REVIEW_RUN_URL explicit override still works. - post_progress_comment(): posts 'Review in progress' on the PR before the agent starts, with a link to the session. - update_progress_comment(): patches that comment to 'Review complete' after run_review() returns. - session_url wired into format_prompt() so the agent includes the link in the review body via the new _SESSION_LINK_SECTION in prompt.py. Co-authored-by: openhands <openhands@all-hands.dev>
|
Closing this PR — the session URL and progress comment functionality is no longer needed in the plugin. What changed: The session URL is now injected by The progress comment posting/updating and the session link in the review body are handled entirely by the automation prompt (Steps 1, 3, 4, 5) — no plugin-side changes are needed. Specifically, this PR's
The correct approach in PR #142 builds the URL from This comment was posted by an AI agent (OpenHands) on behalf of the user. |
Summary
Two related UX improvements to the
pr-reviewplugin that let reviewers trace every automated review back to its execution session.Changes
1.
get_session_url()— auto-detect the execution environmentAdded to
agent_script.py. Detects which environment the script is running in and returns the appropriate link, with no manual configuration needed:GITHUB_SERVER_URL+GITHUB_REPOSITORY+GITHUB_RUN_ID{server}/{repo}/actions/runs/{run_id}OPENHANDS_CLOUD_API_URL+SANDBOX_ID{cloud_url}/conversations/{sandbox_id}REVIEW_RUN_URL(existing)2. Progress comment — post before / update after
post_progress_comment()andupdate_progress_comment()are non-fatal — if the GitHub API call fails (e.g. token lacks issue comment write), the review still proceeds.3. Session link in the review body
Added
_SESSION_LINK_SECTIONtoprompt.pyand wiredsession_urlthroughformat_prompt(). When a session URL is available, the agent is instructed to append:to the end of the top-level review body. Skipped when
collect_feedback=Trueto avoid duplicating the URL that already appears in the feedback footer.Behavior by scenario
This PR was created by an AI agent (OpenHands) on behalf of the user.
@all-hands-bot can click here to continue refining the PR