Skip to content

mcp: make batch-first apply_patch the stated default - #767

Open
ActArtech wants to merge 2 commits into
pascalorg:mainfrom
ActArtech:docs/mcp-batch-first-main
Open

mcp: make batch-first apply_patch the stated default#767
ActArtech wants to merge 2 commits into
pascalorg:mainfrom
ActArtech:docs/mcp-batch-first-main

Conversation

@ActArtech

@ActArtech ActArtech commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Makes batch-first apply_patch usage the stated default across MCP guidance surfaces. The tool already validates all ops before applying any; this only updates agent-facing copy.

  • Tool description (apply_patch): prefer one call per build step; do not loop one-op calls
  • Agent guide: same batch-first rule for bulk graph edits
  • from_brief preamble: "One patch per phase"
  • MCP README tool table row: batch-first wording

No runtime behavior change.

How to test

  1. bun test packages/mcp/src/tools/apply-patch-batch-first.test.ts — all pass
  2. bun test packages/mcp/src/tools/apply-patch.test.ts -t "applies a batch of create" — still applies atomically
  3. bun run check packages/mcp/src/tools/apply-patch-batch-first.test.ts packages/mcp/src/tools/apply-patch.ts packages/mcp/src/prompts/from-brief.ts packages/mcp/src/resources/agent-guide.ts

Screenshots / screen recording

N/A — non-visual docs/guidance change.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Note

Low Risk
Documentation and MCP tool metadata only; no changes to patch validation, persistence, or scene graph logic.

Overview
This PR does not change apply_patch runtime behavior; it aligns agent-facing copy so batch-first is the stated default everywhere.

The apply_patch tool description now tells hosts to send all create/update/delete ops for a build step in one atomic call (stable order, cross-op id references), and to avoid looping one-op calls because a single batch validates once and pays snapshot/save cost once.

The same guidance is added to the agent guide, the from_brief prompt preamble (“One patch per phase”), and the MCP README tools table.

apply-patch-batch-first.test.ts locks in that wording on the registered tool, AGENT_GUIDE, buildFromBriefPrompt, and the README.

Reviewed by Cursor Bugbot for commit d9a6310. Bugbot is set up for automated code reviews on this repo. Configure here.

ActArtech and others added 2 commits September 6, 2026 15:22
Tool description, agent guide, from-brief preamble, and README now instruct agents to compose one atomic apply_patch batch per phase instead of looping single-op calls. The tool already validates all ops before applying any; only the guidance was missing.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Lock the tool description, agent guide, from_brief preamble, and README
row that state batch-first as the default without changing apply_patch
runtime behavior.
@pascal

pascal Bot commented Sep 6, 2026

Copy link
Copy Markdown

I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…).

Please try again, rephrase, or reach out if it keeps failing.

Error id: 911f17bd-c607-4a56-89fa-23a5e0f6113b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant