[Bug] PR review-comment monitor re-dispatches the assistant's own replies as new review comments (infinite loop)

Status Open
Reported on v2.1.224
Maintainer reply None cached
Activity 1 comment · opened Aug 7, 2026

Summary

The PR review-comment monitor surfaces the assistant's own replies back to it as "1 new review comment" with instructions to address them. Since addressing a comment means posting a reply, and that reply is then surfaced as new feedback, this loops indefinitely unless the model recognises its own output and declines to act.

Observed 4 times in a single session, across two different pull requests.

Why author-based filtering doesn't catch it

The obvious guard — "skip comments authored by the user" — doesn't work, because replies are posted through the user's own GitHub credentials. A genuine human review and the assistant's automated reply are byte-identical in the user.login field:

# a real review comment
{"author": "<user>", "mine": false}

# the assistant's own reply, echoed back as "new feedback"
{"author": "<user>", "mine": true}

The only reliable discriminator is the trailing marker line, which the monitor's own instructions mandate:

End each reply with the line "_🤖 Addressed by Claude Code_" so reviewers can see it was automated.

Suggested fix

One condition, before dispatch: drop comments whose body ends with that marker.

The monitor already requires the marker to be present, so this needs no new convention — it just consumes the signal it asks for. Optionally also skip comments posted by the same session.

Impact

Each false dispatch costs a full turn, and the natural response is to post another reply — which both adds noise to the PR and feeds the next iteration. Without an explicit rule telling the model to check first, this does not terminate on its own.

This affects anyone whose automated replies carry a signature line, which is the documented behaviour.

Workaround

A rule in ~/.claude/CLAUDE.md instructing the model to verify authorship before responding:

gh api repos/<owner>/<repo>/issues/comments/<id> \
  --jq '{mine: (.body | endswith("_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_"))}'

This works — it caught all four occurrences — but it filters after the event has already been dispatched and a turn consumed. The fix belongs in the monitor.

A related, smaller point

The dispatch text is always "Please address the feedback and push a fix." Many reviews request no code change (an approval, an observation, a process note). The wording pushes toward manufacturing a commit to satisfy the template. Softening it to something like "address the feedback if a change is warranted" would help.

Environment

  • Claude Code 2.1.224
  • macOS 26.4

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗