How It Works
Full Review Flow
trigger comment -> gate event -> fetch PR -> annotate diff -> call LLM -> validate -> publish
- A comment event arrives from GitHub Actions or a GitHub App webhook.
- The trigger gate checks the event type, action, comment author association, trigger phrase, and PR state.
- The reviewer fetches PR metadata and changed files.
- Each diff hunk is annotated with addressable line markers such as
[R 42]for the new side and[L 11]for the old side. - Repository rules, optional context-script output, and optional tool specs are added to the prompt.
- The LLM returns a review summary, review event, and inline comments.
- Inline comments are validated against the real diff positions.
- Invalid comments are dropped.
- The review is published, or in web app mode stored as an editable draft.
Follow-Up Flow
When someone mentions the trigger on a PR review comment, the reviewer answers that specific inline question in the same thread. The prompt includes the comment anchor, the diff hunk, the follow-up question, repo rules, and any available tools.
Follow-up replies are plain Markdown, not full review JSON.
Staged Reviews
In the web app, the LLM output becomes a draft. The reviewer can:
- edit the summary;
- change the review event;
- edit inline comment text;
- discard individual comments;
- publish or discard the whole draft.
APPROVE events are blocked unless ALLOW_APPROVE=1.
Tool Loop
When a repository checkout is available, the model can request bounded tool calls to inspect context beyond the diff. The loop stops when the model returns a final review, when input-token caps are hit, or when tool-iteration limits are reached.