Skip to content

tweak(edit): separate edit tool error message with clearer guidance to avoid llm doom editing loop#2051

Merged
thdxr merged 1 commit into
anomalyco:devfrom
spoons-and-mirrors:tool/edit-error-change
Sep 5, 2025
Merged

tweak(edit): separate edit tool error message with clearer guidance to avoid llm doom editing loop#2051
thdxr merged 1 commit into
anomalyco:devfrom
spoons-and-mirrors:tool/edit-error-change

Conversation

@spoons-and-mirrors

@spoons-and-mirrors spoons-and-mirrors commented Aug 18, 2025

Copy link
Copy Markdown
Contributor

Summary

Changing edit tool error message in case of match from:

  • oldString not found in content or was found multiple times

to

  • oldString not found in content
  • oldString found multiple times and requires more code context to uniquely identify the intended match

Should drastically improve edit error handling by the LLM which tend to tunnel vision on the first part of the error (the "not found" part), when the LLM knows it's there, and thus behave like it's a tool error and thinks retrying will make it work.

See it in action

image

@adamdotdevin
adamdotdevin requested a review from thdxr August 19, 2025 10:32
@thdxr
thdxr merged commit 900fe5c into anomalyco:dev Sep 5, 2025
1 check passed
@spoons-and-mirrors
spoons-and-mirrors deleted the tool/edit-error-change branch September 5, 2025 16:38
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Rwanbt pushed a commit to Rwanbt/opencode that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
avion23 pushed a commit to avion23/opencode that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants