Skip to content

fix: write tool data-loss prevention - atomic pre-existence check before overwrite#31898

Closed
LifetimeVip wants to merge 3 commits into
anomalyco:devfrom
LifetimeVip:fix/data-loss
Closed

fix: write tool data-loss prevention - atomic pre-existence check before overwrite#31898
LifetimeVip wants to merge 3 commits into
anomalyco:devfrom
LifetimeVip:fix/data-loss

Conversation

@LifetimeVip

@LifetimeVip LifetimeVip commented Jun 11, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #31248 #30864

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Fix write tool silently overwriting existing files - add atomic pre-existence check with wx flag, preserve ToolFailure errors, clear 'use edit' message.

How did you verify your code works?

Tested in custom fork, verified write refuses to overwrite and returns actionable error.

Screenshots / recordings

N/A - logic change, not UI

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Jun 11, 2026
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jun 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@LifetimeVip

Copy link
Copy Markdown
Author

@thdxr @jlongster @rekram1-node @simonklee @Hona these 8 PRs together fix 30 open issues (compaction context loss, Windows encoding, tool error handling, security, etc.). All are mergeable with no conflicts. Would appreciate a review when you have time.

@simonklee simonklee closed this Jun 11, 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] File modification tools (edit/write/apply_patch/shell) lack data-loss prevention guards

2 participants