Skip to content

ci(grok): place findings inline and tighten the review - #420

Merged
AbysmalBiscuit merged 8 commits into
mainfrom
grok-review-nonblocking
Oct 18, 2026
Merged

AbysmalBiscuit merged 8 commits into
mainfrom
grok-review-nonblocking

Conversation

@AbysmalBiscuit

@AbysmalBiscuit AbysmalBiscuit commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Agent summary

Grok review lost most of its value on the way to the PR. On 10 of 40 recent runs GitHub rejected the inline review, because one comment cited a line outside the diff, so every finding fell back to the review body with no thread. Authors fixed about one in six of its findings, against about two in three for the Codex connector. It repeated findings on every push, took many slow turns paging pr.diff, and left stale change requests behind when a run was cancelled.

  • Placement. Each finding now quotes its cited line. The post step moves a finding to the nearest line holding its quote, trims its range to the last hunk it overlaps, and otherwise anchors it at the file's nearest diff line with a link to its real lines. Only a finding whose quote is in no tracked file, or whose file is not in the diff, stays in the body. A failed post prints GitHub's reason. Replaying the six logged 422 runs puts all 15 of their findings on valid diff lines.
  • Blocking. Only a P0 finding requests changes; every other review is a comment. Earlier change requests are dismissed after the new review posts, not before.
  • Prompt. The instructions move to .github/grok-review-prompt.md: the eight criteria of Codex's review rubric, a false-positive list after Anthropic's code-review plugin, a default of no findings, and the toolchain CI builds with. The diff goes in the prompt, and earlier findings, with each thread's state and replies, come with an instruction not to repeat them.
  • Hardening. The post step refuses a payload that contains the xAI key, the run deletes .agents/ with the other harness config before --trust loads it, and the comment on that step now says why.

Caveats

0 departures

0 loose ends

0 assumptions

Conceptual Changes

None

Proof

  1. Replaying the logged Grok output of runs 39082502204, 39055700412, 39093909393, 39088618040, 39090880430 and 39082471759 (each a 422) through the new placement puts all 15 findings on diff lines, both ends of each range in one hunk; with quotes taken three lines off, 14 land inline and the one quoting a blank line goes to the body.
  2. .github/grok-review-payload.jq gives REQUEST_CHANGES for a P0 finding and COMMENT for a P1.
  3. .github/grok-review-earlier.jq on PR fix: report a missing home instead of panicking #416's threads lists both resolved threads with their replies and the five findings that went only into review bodies.
  4. The Grok review job on this PR runs the changed workflow, since pull_request runs the workflow from the PR's head.

Merge Danger

Door: ↔️ two-way

Blast Radius: ⚙️ service

  • A Grok finding in the fallback body (when GitHub rejects inline comments) opens no thread, so it no longer gates the merge.

🤖 Generated with Claude Opus 5.5 via Claude Code

AbysmalBiscuit and others added 2 commits October 18, 2026 09:35
A Grok run cancelled by a new push, or stopped by the timeout, left its
earlier change request standing, so the PR showed as blocked until a
later run finished and dismissed it.

Every review is now a comment. Each inline finding still opens a review
thread, and the ruleset requires threads to be resolved before merge, so
findings still gate the merge. The step that dismissed earlier change
requests has nothing left to dismiss and is removed.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Grok flagged std::fs::File::lock as unstable five times on one PR,
although the CI toolchain ships it as stable. Its recall of Rust lags
the toolchain.

The workflow installs the stable toolchain CI tests with and names its
version in the prompt, with the instruction to treat every API it ships
as stable. The prompt also asks for one finding per root cause, so one
mistake no longer opens a thread at each site.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T07:39:03.586236Z ba5ecff PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡ Grok Review

Reviewed commit: ba5ecff4b4

✅ No issues found.

The review event change, the removed dismissal step, and the stable toolchain prompt are consistent with the workflow and leave existing code and tests intact.

A P0 finding breaks every input, so it blocks the merge as a change
request. Lower priorities stay comments gated by their review threads.
The step that dismisses the bot's earlier change requests returns, so a
review of a later commit replaces a P0 block.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba5ecff4b4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/grok-review-payload.jq Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡ Grok Review

Reviewed commit: 366976bc2f

❌ Patch is incorrect: 1 finding.

The payload still requests changes for a priority-0 finding, so a cancelled or timed-out run can leave a stale change request that blocks the merge.

Comment thread .github/grok-review-payload.jq
@AbysmalBiscuit AbysmalBiscuit changed the title ci(grok): stop blocking merges on stale reviews ci(grok): block merges only on P0 findings Oct 18, 2026
AbysmalBiscuit and others added 5 commits October 18, 2026 10:35
GitHub rejects a whole review when one comment falls outside the diff.
Grok cited lines past a hunk edge or outside any hunk on 10 of 40 recent
runs, so every finding on those runs fell back to the review body, with
no thread and no suggestion. The log kept only "HTTP 422", not the
reason.

Each finding now carries a quote of its cited line. The post step moves
the finding to the nearest line holding that quote, trims its range to
the last hunk it overlaps, and otherwise anchors it at the file's
nearest diff line with a link to its real lines. Only a finding whose
quote is in no tracked file, or whose file is not in the diff, stays in
the body. A failed post prints GitHub's reason. The review object is
read from .structuredOutput first. Earlier change requests are
dismissed only after the new review posts, so a failed post leaves the
old block in place.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Grok runs with XAI_API_KEY in its environment and can read files. A
prompt injection could have it quote the key in a finding, and Actions
masks secrets only in logs, not in a review posted through the API.
The post step now fails instead of posting a payload that contains the
key.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Authors fixed about one in six Grok findings, against about two in
three for the Codex connector. Grok also paged pr.diff through read_file
1000 lines at a time, which cost large PRs many slow turns.

The static instructions move to .github/grok-review-prompt.md. They take
the eight criteria of Codex's review rubric, a false-positive list after
Anthropic's code-review plugin, a default of no findings, and the quote
field the post step places comments by. The workflow appends the PR, the
toolchain, and the diff itself, which falls back to pr.diff only past
1 MB.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Each run reviewed the whole PR from scratch, so a push brought back
findings the author had already fixed or answered, often in new words.

A step before the review reads the PR's review threads and review
bodies over GraphQL and lists this reviewer's earlier findings: each
thread with its state and replies, then titles found only in a review
body. The prompt tells Grok to report none of them again unless the new
commits made the issue worse. Inline comments carry a hidden
grok-review marker, so the list still finds them once the review posts
through the app identity.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Grok reads .agents/ as a config root, and the PR controls it, yet the
step deleted only .grok, .claude, .cursor and .mcp.json before running
with --trust. The comment above the step read as "drop --trust" while
the command kept the flag, and it said headless dontAsk cancels the
turn, which the Grok source does not bear out. It now says why the
deletion comes first.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@AbysmalBiscuit AbysmalBiscuit changed the title ci(grok): block merges only on P0 findings ci(grok): place findings inline and tighten the review Oct 18, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡ Grok Review

Reviewed commit: 6bf0d54001

✅ No issues found.

The payload, line anchoring, and workflow changes keep reviews inside the diff and request changes only for P0 findings, and existing code and tests stay intact.

@AbysmalBiscuit
AbysmalBiscuit merged commit 17402f5 into main Oct 18, 2026
19 checks passed
@AbysmalBiscuit
AbysmalBiscuit deleted the grok-review-nonblocking branch October 18, 2026 09:09
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