Skip to content

fix(pr-review): let a rewritten comment drive the reconcile round - #46

Merged
Troublor merged 1 commit into
mainfrom
ci/comment-edit-rounds
Sep 14, 2026
Merged

Troublor merged 1 commit into
mainfrom
ci/comment-edit-rounds

Conversation

@Troublor

Copy link
Copy Markdown
Collaborator

Problem

mega-putin answers review feedback by posting a placeholder the moment it picks the work up (:mag: Looking into this...) and editing that same comment into the real answer minutes later. On megaeth-labs/mega-agents#317 that produced:

time event
12:15:12 mega-putin posts the 26-char placeholder
12:15:15 issue_comment.created → review round runs. Run log: conversation: 1 of 1 timeline entries · 26 chars — it reconciled the placeholder
12:16:11 status comment republished: still "1 open question"
12:20:31 mega-putin edits the comment into the real answer → no event, no round, ever

The question is still open on that PR with its answer sitting directly above it. Not a bot-filtering problem — allowed_bots: mega-putin is set and the run log shows the round proceeding under mega-putin[bot]. The round simply landed on the wrong revision of the comment, and the documented trigger recipe subscribes to [created] only.

Change

  • prepare skips any issue_comment whose body carries claude-review:skip — the opt-out marker a bot puts on a placeholder it intends to rewrite. The rewrite replaces the whole body, marker included, so the resulting edit is a normal comment and does drive a round.
  • The body reaches prepare as TRIGGER_COMMENT_BODY in the environment, never interpolated into the shell script: it is attacker-controlled text.
  • The CLAUDE-CI.md recipe now subscribes to [created, edited], declines a marked comment in the job if as well (one step earlier, before a runner starts), and notes that an @claude mention job must pin github.event.action == 'created' so editing an old comment cannot re-run it.

The reviewer-login exclusion consumers already carry is what keeps the sticky status comment — rewritten in place every round — from retriggering under edited.

Follow-ups (separate PRs)

  • Consumer workflows in the 8 repos that call this action need edited added.
  • mega-agents adds the marker to the placeholder comments its handlers post.

Test plan

  • python3 -m unittest test_review_pipeline — 106 tests pass, including two new ones covering the marker and the env wiring.

Note: .github/actions/claude-pr-review/__pycache__/*.pyc is tracked in this repo and gets dirtied by running the tests; I reverted it here, but it probably wants deleting + gitignoring.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DMw1H8WTihb5CfQ7tabxdt

An agent answering review feedback posts a placeholder the moment it
picks the work up (":mag: Looking into this...") and rewrites that same
comment into the real answer minutes later. The reviewer spent its round
on the placeholder and never saw the answer: the answer arrived as an
`edited` event, which the documented trigger recipe did not subscribe
to, so the question stayed open forever with the answer sitting right
above it (megaeth-labs/mega-agents#317).

Move the round to where the content is. `prepare` now skips any
issue_comment whose body carries `claude-review:skip`, the marker a bot
puts on a placeholder it intends to rewrite; the rewrite replaces the
whole body, marker included, so the edit is a normal comment again. The
body reaches prepare through the environment rather than shell
interpolation — it is attacker-controlled text.

The trigger recipe now subscribes to `[created, edited]` and declines a
marked comment in the job `if` too, before a runner starts. Consumers
keep their reviewer-login exclusion, which is what stops the sticky
status comment — rewritten in place every round — from retriggering.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DMw1H8WTihb5CfQ7tabxdt
@Troublor
Troublor merged commit 46208e8 into main Sep 14, 2026
9 checks passed
@Troublor
Troublor deleted the ci/comment-edit-rounds branch September 14, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant