feat(mcp): reduce redundant diff resolution across multi-tool workflows
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 14
- Forks
- 1
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 16
Description
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
- At least one approach implemented
- Shared diff resolution saves measurable git work (test with a large repo)
- Response envelopes include the shared digest for downstream chaining
- No regression in single-operation calls
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how tool calls resolve the source and construct response envelopes, then compare the digest-hint and composite-operation options. Use the acceptance criteria to test repeated operations on a large repository, verify shared meta.digest values and measurable savings, and confirm single-operation calls remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, typescript
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100