Edit doesn't apply leading to wasteful failure, but success on Reapply

Edit doesn’t apply leading the agent (here Claude Sonnet 3.7 MAX) on a wild goose chase with other edit failures along the way, but the same edit succeeds when clicking on Reapply in the UI.

As shown above, after clicking Reapply, the edit changes into a diff that correctly performs the deletions.

In the original edit session, the agent then successfully tries one-by-one deletions, but then switches back to “batch” deletion that fails again.

Expected: the first deletion edit should act the way that its Reapply actually did.

Actual: the deletion edit got ignored.

Observation: the span of the code to delete was shorter at the time of Reapply because of the detailed deletions the agent did after.

Hypothesis: the “apply edit” operation is very sensitive to the length of the code to match against and fails when the code to match exceeds ~50 lines.

1 Like