Q Agentic Chat: Writing File should not be allowed if the file has changed since the last time the agent read it
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 807
- Avg merge
- 10h 12m
- Merged PRs (30d)
- 7
Description
## Problem
If the user has changes to a file that the agent is also editing (i.e. you are "pair programming"), and a new change is requested by the agent, it overwrites the user changes because its baseline for new edits is its own most recent edit, rather than the live file state.
## Expected behavior
The latest changes to the file should be re-read before any edits are generated and applied. If there are unsaved edits to the file then the user should be asked to save them before the agent can proceed (this is an IDE plugin after all, it should be able to know about this).
Claude Code does this by blocking edit attempts to files which have changed since the agent last read them and telling it to re-read the file first, though that is not necessarily the only way to do this.
Contributor guide
Research direction
No file or test is named. Start by tracing Q Agentic Chat's file-writing path and how it tracks the agent's last read or edit; verify whether unsaved or externally changed content can be detected before applying an edit. Done means agent edits no longer overwrite newer user changes and the user is prompted to save or the agent is required to re-read the file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100