Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/swarm-review-classifier/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 6ed88ad70a review classifier: classifications of one PR share a cached prefix
On the API key runtime the classifier now hands claude its prompt as one
stream-json user message (`--input-format stream-json`) with two text
blocks: the PR's shared context, carrying `cache_control: ephemeral`, and
the classification's question.

As plain stdin text the whole prompt was one block, and claude puts its
only message breakpoint on the last block, after the question. The cache
writes an entry only where a breakpoint is, so no entry ended at the
shared-context/question boundary. Every classification wrote the whole
prompt and none read it (production: cacheRead ~0, cacheCreation ~input).
The system-prompt prefix (~270 tokens) is under the minimum cacheable
length. Captures against a local listener with a dummy key (claude
2.1.223) show the client breakpoint survives on the shared block, and that
claude adds none there on its own.

The PR stays in the user role: moving it into the system prompt would give
untrusted PR text the system prompt's authority.

`Model::ask` takes a `Prompt { shared, question }`. The ACP runtime joins
it back into the same text it sent before.

Refs #5245
2026-10-14 18:26:11 +02:00
..
acp.rs review classifier: classifications of one PR share a cached prefix 2026-10-14 18:26:11 +02:00
aggregate.rs swarm-review-classifier: answer a try-out with one claude run per classification 2026-10-12 13:11:21 +02:00
answer.rs review classifier: truncate an over-long reason instead of dropping the verdict 2026-10-13 21:23:03 +02:00
child_env.rs review classifier: run on ACP when the swarm settings choose it 2026-10-14 10:14:36 +02:00
cost.rs review classifier: commit shas and index lines stay out of the prompt 2026-10-14 13:52:36 +02:00
main.rs review classifier: every ACP run gets one shared, empty cwd 2026-10-14 14:45:59 +02:00
prompt.rs review classifier: classifications of one PR share a cached prefix 2026-10-14 18:26:11 +02:00
run.rs review classifier: classifications of one PR share a cached prefix 2026-10-14 18:26:11 +02:00