gfargo / gfargo/coco

feat(mcp): reduce redundant diff resolution across multi-tool workflows

Open
#2,045 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.