Skip to content

Live PR reviews spend more turns with Loom: the brief lists leads, not a verdict #2040

Done

Description

@zlareb1

Company

ClickHouse

Component

Code index

Use case

A PR-review agent ran 14 complete sessions on two ClickHouse PRs (#135745, #124680), with Loom on and off, on the same commit and binary. With Loom, sessions cost 13–23% more, took the same time and found the same bugs. Most of that cost came from a client bug, now fixed. The rest comes from the shape of Loom's answers:

  • The agent treats code.review_brief as a to-do list. On #135745, sessions with the brief took 96–108 turns, against 64–79 without, and reached the same verdict.
    • 6 of the 10 touched functions listed were REGISTER_FUNCTION (×3), create (×2) and isDeterministic, all with fan-in 0.
    • Test links such as tests for FunctionGetMacro::create: test.py, test.py (+4521) carry no signal and print no path.
    • code.test_gate listed 25 obligations, including the generic 00534_functions_bad_arguments* suites.
    • For a small, well-tested PR the brief ran to 3.8k characters, when the useful answer was "covered, no gaps".
  • code.test_gate and code.tests_for read the indexed head. On an older PR the head already holds later fixes: one session on #124680 found the regression test added by a later fix.
  • Clients cannot tell when Loom is degraded. In three windows over two weeks, between 40% and 100% of calls failed (one window: 1,618 of 1,618), and reviews produced without Loom looked normal.
  • The agent made 0–3 Loom calls per session. Every answer was correct, but grep over a page-cached tree answers a plain lookup in 0.13 s. The answers grep cannot give are callers through overrides, whether a function is actually tested, and which later PR changed these lines.
  • About 20 of the 30 memories recalled for #135745 were PR summaries of 1.5–2k characters each. They push the actionable lessons (false positives, maintainer preferences) down the block.
  • The client reported every recalled memory as used through run.complete(memories_used=…) while a prompt cap hid them from the model. Those used and evidence events now rank rows the model never read, and Loom has no way to take back a run's credit.

What works: recall relevance (the top hit was the exact precedent, #121398), correct index answers, and a code.review_brief point read of about 100 ms.

Describe the solution you'd like

In priority order:

  1. code.review_brief answers with a verdict. A top-level verdict (for example covered_no_gaps) before any lead. Registration, factory and constructor hunks are collapsed out of the touched symbols. Test links keep the strongest evidence class and always print paths. code.test_gate tests are ranked by evidence class and cut, so generic suites that reach every function drop out.
  2. at: <merge_sha> on code.test_gate and code.tests_for. They answer as of that commit, so a replay or backfill sees only what a reviewer had at merge.
  3. A degraded signal. One degraded field on any response served from a fallback or a partial read, and a status op clients can poll for current incidents.
  4. Answers grep cannot give, by default. code.symbol and code.grep lead with callers through overrides, measured test coverage and the later PRs that changed the lines.
  5. A kind facet on memory search, and compact PR summaries. A filter that asks for lessons first, and a short form of each PR summary.
  6. Retracting a run's usage credit. An op that cancels the used, evidence and harm events a run or a time window wrote, as compensating events, so memory_usage_totals corrects itself and the history stays readable. Separately, consider crediting only what a client reports it delivered to the model, not what it recalled.

Describe alternatives you've considered

  • sections and token_budget on code.review_brief shorten the brief but leave it a list of leads.
  • code.callers, code.coverage_claim and code.symbol_history answer the grep-proof questions, but each is a separate call that an agent skips when grep is as fast.
  • memory.outcome with negative records harm; it does not undo used or evidence credit.

Where the need comes from

I hit this need myself

Additional context

Each item is one pull request. Two PRs can show cost and behaviour; they cannot show that Loom never helps find bugs.

Activity

  1. added
    enhancement
    help wanted
    up-for-grabs
    and removed
    help wanted
    up-for-grabs
    on Dec 2, 2026
  2. self-assigned this
    on Dec 2, 2026
  3. 1 remaining item

  4. zlareb1 commented on Dec 4, 2026

    @zlareb1
    MemberAuthor

    All six items are on main:

    1. code.review_brief answers with a verdict: code.review_brief answers with a verdict, and the wiring a PR adds and generic test-map suites drop out #2046.
    2. at_commit on code.test_gate and code.tests_for: code.test_gate and code.tests_for answer as of a commit with at_commit #2043.
    3. degraded on responses served from a fallback, and ops.incidents: Responses served from a fallback say so in degraded, and ops.incidents lists current incidents #2047.
    4. The lead block on code.symbol and code.grep: code.symbol and code.grep lead with each definition's callers, test coverage and changing PRs #2048.
    5. The kind facet on memory.search and summaries by their head: memory.search serves requested kinds first and summaries by their head #2044.
    6. run.retract_credit, and memories_delivered on run.complete so only keys a client showed the model earn credit: run.retract_credit cancels a run's usage credit with compensating events #2045.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions