Skip to content

Cut review latency with a bounded output budget and cache-stable prompt prefix - #34

Merged
morgaesis merged 1 commit into
mainfrom
review-latency
Jul 10, 2026
Merged

morgaesis merged 1 commit into
mainfrom
review-latency

Conversation

@morgaesis

Copy link
Copy Markdown
Contributor

Review latency is dominated by output generation, not startup: a 12k-token completion alone takes minutes at typical provider throughput. Review, JSON-repair, and semantic-correction calls now carry a 4096-token output cap and the prompt asks for terse findings (40-word summary, 12-word titles, 60-word bodies with evidence, impact, and action); interactive answers keep their provider default. The system prompt is reordered so global rules, the response contract, and the built-in content-policy baseline form a byte-stable prefix across repositories for implicit prompt caching, with repo-specific sections and the diff after it; the effective policy text is unchanged. PR metadata and full-diff fetches now run in parallel. Verified with fmt, clippy -D warnings, 82 library tests, 34 wiremock e2e tests, and the 40-fixture hermetic benchmark (33 TP, 0 FP, 0 FN).

A review's wall-clock is dominated by output generation: the recorded
12k-completion run spends 3 to 7 minutes generating at typical provider
throughput. Cap review, JSON-repair, and semantic-correction calls at
4096 output tokens and instruct terse findings (40-word summary, 12-word
titles, 60-word bodies with evidence, impact, and action). Interactive
answers keep their provider default.

Reorder the system prompt so the global rules, response contract, and
built-in content-policy baseline form a byte-stable prefix across
repositories, with repo focus, guardrails, policy additions, tone, and
the diff after it, matching implicit prefix-cache semantics. The
effective policy text is unchanged.

Fetch PR metadata/check ownership and the full diff in parallel;
incremental diffs still wait for the selected head SHA.

@postil-dev postil-dev 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.

  • error error .postil/provider:1 — Model provider unavailable · confidence 1.00 · kind: uncertainty

Model: moonshotai/kimi-k2.6

@morgaesis morgaesis closed this Jul 10, 2026
@morgaesis morgaesis reopened this Jul 10, 2026
@morgaesis
morgaesis merged commit 0a04ef0 into main Jul 10, 2026
10 checks passed
@morgaesis
morgaesis deleted the review-latency branch July 10, 2026 16:41
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