You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: [AI-450] auto-refresh stale files in edit and write tools instead of failing
When a file is modified externally (by a formatter, linter, or file watcher) between
a read and edit/write, the tools now auto-refresh the read timestamp and re-read the
file contents instead of throwing "modified since it was last read".
This prevents the agent from entering retry loops of hundreds of consecutive failures
when external processes modify files during editing sessions.
Changes:
- Add `FileTime.assertOrRefresh()` that returns `{ stale: boolean }` instead of throwing
- Update `EditTool` and `WriteTool` to use `assertOrRefresh()` and re-read file contents
- Update test to verify auto-refresh behavior
- Original `FileTime.assert()` preserved for backward compatibility
Closes#450
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments