mcp: make batch-first apply_patch the stated default - #767
Open
ActArtech wants to merge 2 commits into
Open
Conversation
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.
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Makes batch-first
apply_patchusage the stated default across MCP guidance surfaces. The tool already validates all ops before applying any; this only updates agent-facing copy.apply_patch): prefer one call per build step; do not loop one-op callsfrom_briefpreamble: "One patch per phase"No runtime behavior change.
How to test
bun test packages/mcp/src/tools/apply-patch-batch-first.test.ts— all passbun test packages/mcp/src/tools/apply-patch.test.ts -t "applies a batch of create"— still applies atomicallybun 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.tsScreenshots / screen recording
N/A — non-visual docs/guidance change.
Checklist
bun devbun checkto verify)mainbranchNote
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_patchruntime behavior; it aligns agent-facing copy so batch-first is the stated default everywhere.The
apply_patchtool 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_briefprompt preamble (“One patch per phase”), and the MCP README tools table.apply-patch-batch-first.test.tslocks 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.