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
A detected external edit pauses the old write path. Only a recorded re-plan with relevant verification releases a revised write; uncertainty stays with a human or a bounded handoff.

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

  1. Pause further writes. Stop the active write path before it overwrites newly observed state.
  2. 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.
  3. 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.
  4. 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.
  5. Verify the revised state. A prior passing result validates only the state it actually tested.

Capture evidence before asking the model to reconcile it

RecordWhy it matters
Task and agent-plan revisionEstablishes which assumptions were active before the edit.
Before/after revision identifiers and diffMakes the concrete change reviewable.
Changed paths and affected checksBounds what the new plan must reconsider.
User context and resolution decisionSeparates stated intent from code-state evidence.
Post-decision verification resultConnects 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.