What problem does this solve?
A common agent workflow runs multiple operations on the same diff: recap to understand what changed, review to find issues, commit-draft to compose the message. Each call independently resolves the source (runs git diff, computes the digest, applies budget truncation). On a large repo this is 3x the git work and adds latency.
Proposed solution
Two complementary approaches (either or both):
Option A: Accept a pre-resolved digest to skip re-resolution
If a call returns meta.digest: "sha256:abc...", a subsequent call could pass source: { digest: "sha256:abc...", ... } as a hint. If the current diff still matches that digest, skip re-resolution and reuse the cached text. If it doesn't match (working tree changed between calls), resolve normally.
Option B: Composite operation
A new coco_batch tool (or operations array in the input) that runs multiple operations on a single resolved source:
{
"source": "staged",
"operations": ["review", "commit-draft"],
"options": { "conventional": true }
}
Returns an array of envelopes, one per operation, all sharing the same meta.digest.
Trade-offs
- Option A is simpler to implement but still requires N tool calls
- Option B reduces round-trips but adds schema complexity
- Both maintain the read-only safety model
Acceptance criteria
What problem does this solve?
A common agent workflow runs multiple operations on the same diff: recap to understand what changed, review to find issues, commit-draft to compose the message. Each call independently resolves the source (runs
git diff, computes the digest, applies budget truncation). On a large repo this is 3x the git work and adds latency.Proposed solution
Two complementary approaches (either or both):
Option A: Accept a pre-resolved digest to skip re-resolution
If a call returns
meta.digest: "sha256:abc...", a subsequent call could passsource: { digest: "sha256:abc...", ... }as a hint. If the current diff still matches that digest, skip re-resolution and reuse the cached text. If it doesn't match (working tree changed between calls), resolve normally.Option B: Composite operation
A new
coco_batchtool (oroperationsarray in the input) that runs multiple operations on a single resolved source:{ "source": "staged", "operations": ["review", "commit-draft"], "options": { "conventional": true } }Returns an array of envelopes, one per operation, all sharing the same
meta.digest.Trade-offs
Acceptance criteria