Repository navigation
Replies: 2 comments
|
Source-verified feasibility review at 1. The atomicity seam already exists — the batch slots in cleanly.
2. Naming collision:
export interface FsEditRequest {
oldString: string
newString: string
replaceAll: boolean
}Your proposed provider type ( 3. Diff presentation needs no new view — mostly.
4. fs-e2b gets the biggest win — worth stating in the proposal.
5. Observation policy and escalation stay single-decision. The tool flow is one 6. Schema vs executor enforcement — confirmed your instinct. The 7. Remaining surface for your prototype to be complete (all in Net: the design is compatible with the native literal-edit direction as it stands today; the main decisions are the type-name resolution and whether the batch loop lives in each provider (required for the lock+single-write guarantee) or behind a shared helper. The Discussions-first posture is exactly right per CONTRIBUTING — hoping a maintainer weighs in. |
|
Thanks for the source-level review — this is very helpful.\n\nI agree that reusing \FsEditRequest\ for the batch container would unnecessarily change an already exported public type. Before any upstream submission, I’ll preserve the existing per-operation shape and introduce a separately named batch request/input, with the provider boundary accepting or normalizing the single and batch forms as appropriate.\n\nThe prototype has since been rebased onto the latest \master. It already covers the remaining \ ool-fs\ surface you identified: the system-prompt guidance, executor-level single/batch mutual exclusion and per-operation validation, and the \presentCall\ batch branch. It also includes provider tests for ordered dependent operations, one publication, and no rename/write when a later operation fails.\n\nGood point about \s-e2b: collapsing N sandbox round trips into one is a separate provider-side benefit beyond the model-request and token savings. I’ll add that to the proposal.\n\nI’ll continue to wait for maintainer direction before opening a PR, per \CONTRIBUTING.md. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
I propose extending the native
edittool with an optional orderededits[]form for multiple literal replacements in one file, while preserving the existingold_string/new_stringsingle-edit form.The goal is to reduce model round trips for several deterministic edits in one observed file without switching to an opaque shell script or weakening
fs-observation-policy.{ "file_path": "tasktracker/cli.py", "edits": [ { "old_string": "old block 1", "new_string": "new block 1" }, { "old_string": "old block 2", "new_string": "new block 2" } ] }Motivation and measured cost
In one real development session, five distinct edits to the same already-read file were expressed as five serial
editcalls. Those five calls alone required:The local filesystem operation itself is fast; the dominant cost is the model round trip after each tool result.
This is related to existing reports about file-operation friction and extra rounds:
read → editround trips for bulk mechanical transforms.A shell/script lane remains appropriate for repository-wide mechanical transforms. This proposal targets the middle case: several precise, reviewable literal edits to one observed file.
Proposed semantics
edits[]form.replace_allis true.The provider-level request could use a non-empty operation tuple so direct callers cannot submit an empty successful edit:
Why not only use shell or apply_patch?
This keeps the existing native literal-edit properties:
It is deliberately narrower than a general patch language.
Prototype evidence
I implemented and tested a local prototype across
dsh-fs,fs-local,fs-e2b, andtool-fs.Verification included:
A real headless run with
gpt-5.6-sol,xhighused exactly:readeditcall containing twoedits[]operationsreadThe model used the batch form correctly and the file was updated once.
Trade-offs
Request for maintainer direction
Would this ordered single-file batch form fit the intended native filesystem-tool direction?
I have a working prototype and measured before/after behavior, but I am posting this as a design proposal because
CONTRIBUTING.mdcurrently asks external contributors to use Discussions rather than unsolicited PRs. If maintainers want the code, I can rework it on the latestmasterwith the required provider, snapshot, generated-catalog, bilingual documentation, and Agent Note coverage.All reactions