Skip to content

fix(engine): approve once the reviewer has read every changed line the prompt left out - #46

Merged
TorstenDittmann merged 1 commit into
appwrite:mainfrom
ChiragAgg5k:fix/approve-after-reading-omitted-files
Nov 16, 2026
Merged

TorstenDittmann merged 1 commit into
appwrite:mainfrom
ChiragAgg5k:fix/approve-after-reading-omitted-files

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Large pull requests can never be approved. Files are added to the prompt until maxDiffChars (150k) runs out. Every code file that doesn't fit sets truncated, and that withholds approval, even when the reviewer opens the file with read_file.

This blocks generated SDK release PRs every time. On sdk-for-node#182, src/services/project.ts (64k) and three other files push past the budget.

PR files left out result
appwrite/sdk-for-node#182 3 of 31 Tier S, not approved
appwrite/sdk-for-python#180 1 of 105 Tier S, not approved
appwrite/sdk-for-console#128 2 of 39 Tier S, not approved

Change

files_not_shown
- src/services/project.ts (too large to show; changed lines 12-40, 1030-1210)
Files too large to show are part of the review: read their changed lines with read_file. …
  • createRepoTools takes onRead(path, startLine, endLine). It reports the head lines each read_file actually returned, after the 400-line cap. The reviewer, subagents and verifier all report through it.
  • truncated skips a left-out file once every one of its commentableLines (the head side the diff would have shown) lies inside a range that was read. A file whose diff was too large to load (omitted, no hunks) still withholds approval, because its lines are unknown.
  • The files_not_shown entry for each file that was too large now lists the changed line spans, so the reviewer knows what to read.

The verdict is still made in code: the model cannot claim it read something. Only lines the tool returned count.

Tests

withholds approval for outside contributors and incomplete reviews now covers a scripted reviewer that reads the left-out src/big.ts. The review approves, and the prompt lists changed lines 1-1. With the seen check reverted, that assertion fails (comment instead of approve). bun run test (394 pass), lint and check are all green.

…e prompt left out

A pull request whose diff passes maxDiffChars could never be approved: any code file left out of the prompt withheld approval, even after the reviewer read it with read_file. Record the head lines read_file returns, list each omitted file's changed lines in files_not_shown, and count a file as reviewed once every one of them was read.
@TorstenDittmann
TorstenDittmann merged commit a0fda2a into appwrite:main Nov 16, 2026
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.

2 participants