Feature request
/improve publishes an author self-review checkbox when demand_code_suggestions_self_review = true (pr_code_suggestions.py:495-505 appends - [ ] {text} plus one of three hidden markers: <!-- approve pr self-review -->, <!-- fold suggestions self-review -->, <!-- approve and fold suggestions self-review -->). But nothing reacts when the author ticks it: the webhook branch that should handle the edit is a stub,
# pr_agent/servers/github_app.py:409-410
elif event == "issue_comment" and 'edited' in action:
pass # handle_checkbox_clicked
and both halves of the designed reaction have no caller from this path:
- the fold rendering exists unreached:
publish_persistent_comment_with_history(..., only_fold=True) (pr_code_suggestions.py:613, the if only_fold: branch at :732) — its only invocation passes only_fold=False (:621);
- the approve primitive exists unreached from here:
auto_approve() (github_provider.py:2033, pr.create_review(event="APPROVE")) is only called from the /review flow (pr_reviewer.py:1577).
So demand_code_suggestions_self_review renders a dead checkbox, and approve_pr_on_self_review / fold_suggestions_on_self_review (configuration.toml:265-268) are advertised knobs with no reachable implementation.
Proposal
Handle the tick in the GitHub app:
- In the
issue_comment + edited branch, compare changes.body.from with comment.body: the self-review line flipped - [ ] → - [x] and the body carries one of the three self-review markers.
- Verify the comment is PR-Agent's own suggestions comment (
is_comment_authored_by_pr_agent, git_provider.py:895) and the editor (webhook sender) is the PR author (provider pr.user.login), so a bystander ticking the box cannot approve someone's PR.
- Act per the marker: re-render folded via
publish_persistent_comment_with_history(..., only_fold=True), and call auto_approve() when the marker says approve. Approving uses the same review API the app already uses for feedback, so pull_request_reviews: write should already hold — worth confirming on the app settings.
- Unit tests with
issue_comment edited payload fixtures: an author tick folds/approves per the marker; an edit that does not touch the checkbox is ignored; a non-author tick is ignored; a comment without a marker is ignored.
Scope: the GitHub app only, where the stub sits. The Action runner could share the same detection later via servers/github_common.py (the #3785 pattern), and other providers' servers can follow if they want the feature.
Motivation
The checkbox is the one human-in-the-loop affordance the bot already publishes; wiring it gives authors an explicit "I read the suggestions" gesture that folds the noise and (opt-in) approves the PR, and turns three documented config keys into working behavior.
Feature request
/improvepublishes an author self-review checkbox whendemand_code_suggestions_self_review = true(pr_code_suggestions.py:495-505appends- [ ] {text}plus one of three hidden markers:<!-- approve pr self-review -->,<!-- fold suggestions self-review -->,<!-- approve and fold suggestions self-review -->). But nothing reacts when the author ticks it: the webhook branch that should handle the edit is a stub,and both halves of the designed reaction have no caller from this path:
publish_persistent_comment_with_history(..., only_fold=True)(pr_code_suggestions.py:613, theif only_fold:branch at:732) — its only invocation passesonly_fold=False(:621);auto_approve()(github_provider.py:2033,pr.create_review(event="APPROVE")) is only called from the/reviewflow (pr_reviewer.py:1577).So
demand_code_suggestions_self_reviewrenders a dead checkbox, andapprove_pr_on_self_review/fold_suggestions_on_self_review(configuration.toml:265-268) are advertised knobs with no reachable implementation.Proposal
Handle the tick in the GitHub app:
issue_comment+editedbranch, comparechanges.body.fromwithcomment.body: the self-review line flipped- [ ]→- [x]and the body carries one of the three self-review markers.is_comment_authored_by_pr_agent,git_provider.py:895) and the editor (webhooksender) is the PR author (providerpr.user.login), so a bystander ticking the box cannot approve someone's PR.publish_persistent_comment_with_history(..., only_fold=True), and callauto_approve()when the marker says approve. Approving uses the same review API the app already uses for feedback, sopull_request_reviews: writeshould already hold — worth confirming on the app settings.issue_commentedited payload fixtures: an author tick folds/approves per the marker; an edit that does not touch the checkbox is ignored; a non-author tick is ignored; a comment without a marker is ignored.Scope: the GitHub app only, where the stub sits. The Action runner could share the same detection later via
servers/github_common.py(the #3785 pattern), and other providers' servers can follow if they want the feature.Motivation
The checkbox is the one human-in-the-loop affordance the bot already publishes; wiring it gives authors an explicit "I read the suggestions" gesture that folds the noise and (opt-in) approves the PR, and turns three documented config keys into working behavior.