Writing ·
How should a coding agent handle user edits during a task in 2026?
Treat a user edit as a plan-invalidating state change: pause writes, preserve and inspect the diff, identify affected assumptions and checks, then re-plan or escalate before continuing.
By Youssef Hemimy · coding agents · agent reliability · AgentOps
Treat a user edit during an active coding-agent task as a plan-invalidating state change: pause writes, preserve and inspect the diff, identify affected assumptions and checks, then re-plan or escalate before continuing. The edit may be the right correction; the unsafe move is letting the agent continue on an unstated mixture of its old plan and new code.
- 9
- models evaluated
- 7.7 pp
- lower mean resolve rate in the controlled benchmark
- 1
- reconciliation point per detected edit
01
External edit
Repository state changes during an active task.
02
Pause writes
No further write is released on the old plan.
03
Inspect state
Diff, affected assumptions, and checks become evidence.
Compatible
Re-plan, run the relevant checks, then release the revised write.
Uncertain
Show the concrete conflict and request a human decision.
Out of scope
Cancel or hand off; an edit is not permission to broaden work.
Why a code edit is different from a message
An in-flight message can change an agent’s instructions. An in-flight edit also changes the repository state that later reads, writes, and tests will use. SWE-Touch studies that shared-workspace boundary through controlled task-conflicting Counter-Edits applied while an agent works. Its benchmark result is evidence about that simulation, not a live-collaboration failure rate.
Put an edit-reconciliation gate in the harness
- Pause further writes. Stop the active write path before it overwrites newly observed state.
- Preserve the comparison. Record the task, agent-plan revision, current state, diff, and available user context. Git documents comparisons among working-tree, index, commit, and path endpoints; choose the comparison that matches the workspace.
- Scope the conflict. Identify planned files, assumptions, tests, and pending actions touched by the edit. If the controller cannot bound the impact, mark it uncertain.
- Choose a recorded next state. Re-plan when intent and checks are clear; ask the user when code and task conflict; cancel or hand off when the action scope is no longer safe.
- Verify the revised state. A prior passing result validates only the state it actually tested.
Capture evidence before asking the model to reconcile it
| Record | Why it matters |
|---|---|
| Task and agent-plan revision | Establishes which assumptions were active before the edit. |
| Before/after revision identifiers and diff | Makes the concrete change reviewable. |
| Changed paths and affected checks | Bounds what the new plan must reconsider. |
| User context and resolution decision | Separates stated intent from code-state evidence. |
| Post-decision verification result | Connects the revised state to its acceptance rule. |
Git’s status output can distinguish paths that differ among HEAD, the index, and the working tree, and it can report untracked paths. That makes it useful inspection evidence in a Git workspace; it does not tell the controller what an edit means or authorize the next action.
Re-plan from state, not from courtesy
The paper’s trajectory analysis associates failed runs with missing an external modification, retaining conflicting code, or changing it without rechecking affected behavior. For your own workflow, make the resolution state explicit: compatible changes get a re-plan and relevant checks; interpretable conflicts request a decision; uncertain cases preserve the workspace and stop writes; out-of-scope changes cancel or hand off the pending action.
Bind a resumed write to a production agent tool contract, send uncertain cases into an agent workflow recovery plan, and use reviewer evaluation to measure whether automated review improves the resolution decision.
Keep the paper’s limits inside the policy
SWE-Touch uses controlled simulated edits that conflict with task completion. Its intervention trigger does not model a full-duplex user who observes an agent’s live output and adapts an edit. It therefore cannot establish how often ordinary user edits conflict with a plan, which policy is best for a particular product, or whether a specific coding agent already handles this well.
Use the reconciliation point to collect those answers in your own traces: record the edit, whether the write path paused, the selected resolution, and the relevant acceptance result.
Sources
FAQ
Should every user edit stop a coding agent?
Every detected external edit should create a recorded reconciliation point. A clearly compatible change can lead to an automated re-plan, but the agent should not keep writing under an unexamined old plan.
Does a diff tell the agent which version is correct?
No. A diff records what changed. The controller still needs an acceptance condition, relevant user intent, and a decision about whether the planned action remains authorized.
Does SWE-Touch prove current coding agents fail in real shared workspaces?
No. It is an unreviewed preprint using controlled task-conflicting edits. Its useful prompt is to measure detection, reconciliation, and re-verification in your own workflow.
Can the agent simply rerun all tests after a user edit?
Tests can verify a revised state, but they do not replace reconciling the changed code with the task and the next planned action. Record both the decision to continue and the relevant check result.
Building something that has to hold up?
We do this work for teams — agent reliability hardening, custom MCP servers, and full-stack AI systems built to survive production.