Skip to content

fix(edit): add per-file lock to prevent read-before-write race - #4388

Merged
rekram1-node merged 3 commits into
anomalyco:devfrom
spoons-and-mirrors:fix/edit-race
Dec 15, 2025
Merged

rekram1-node merged 3 commits into
anomalyco:devfrom
spoons-and-mirrors:fix/edit-race

Conversation

@spoons-and-mirrors

@spoons-and-mirrors spoons-and-mirrors commented Nov 16, 2025 •

Copy link
Copy Markdown
Contributor

what the title says.
didn't wrap write.ts and patch.ts with withLock because it doesn't really make sense, but... should I for consistency?

This fixes the read before edit error we got when doing parallel edit calls (reliably?)

Resolves #2882

@rekram1-node

Copy link
Copy Markdown
Collaborator

/review

Comment thread packages/opencode/src/file/time.ts Resolved
@rekram1-node

Copy link
Copy Markdown
Collaborator

/review

Comment thread packages/opencode/src/file/time.ts Resolved
@rekram1-node

Copy link
Copy Markdown
Collaborator

/review

@github-actions

Copy link
Copy Markdown
Contributor

lgtm

@rekram1-node
rekram1-node merged commit 5cf126d into anomalyco:dev Dec 15, 2025
3 checks passed
nalin-singh pushed a commit to nalin-singh/opencode that referenced this pull request Dec 17, 2025
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
androidand pushed a commit to androidand/opencode-skein that referenced this pull request Sep 19, 2026
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.

bug: parallel edit tool calls on same file will error out

2 participants