Repository navigation
Should edit guidance explicitly prohibit parallel edits to the same file? #3017
HandleCoding
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Should the model-facing
editguidance explicitly state that edits targeting the same file must be dispatched sequentially, while edits targeting different files may run in parallel?The filesystem backend already behaves safely: mutations are locked per
targetKey, and guarded edits use the last observed file version. The native tool scheduler also keeps mutation tools exclusive. However, an orchestration layer or parallel-call wrapper can still fan out severaleditcalls before the first call records its new observed version. Those calls share one stale version basis; after one mutation advances the file version, the remaining calls can fail withFS_STALE_VERSION.This is not a request to weaken the stale guard. The guard is correctly preventing lost updates. The question is whether the safe-use constraint should also be made explicit to the model.
Current model-visible guidance
The current
tool:editprompt onmasterexplains literal matching,replace_all, and the read-before-edit requirement, but does not mention same-file parallelism:The tool description is similarly concise:
Reproduction
Using a generic file such as
/tmp/edit-probe.txt:editcalls targeting different unique regions of that same file.FS_STALE_VERSION.This is consistent with the current implementation:
fs-observation-policysupplies the session's observed version as the edit intent.fs-localserializes mutations pertargetKeyand rejects an old expected version.tool-fsrecords the new version after a successful edit.Proposed minimal change
Add one sentence to the
tool:editsystem-prompt guidance, for example:Optionally add a shorter version to the tool description so the constraint remains visible wherever tool-owned prompt sections are omitted.
Why document it if native scheduling is already exclusive?
Alternatives
I would avoid automatic blind retries after
FS_STALE_VERSION: after another edit changes the file, the original literal replacement may no longer represent the same intent. Re-read plus model reconsideration is safer.Questions
editcontract, or only an internal scheduler property?All reactions