Description
While using the edit tool to fix a simple syntax error in a Rust file, the model (gemma4-31b) entered a repetitive failure loop.
Steps to Reproduce:
- The model calls read to get the content of a file.
- The read tool returns the actual content (e.g., if guess << secret secret_number {).
- The model attempts to call edit, but instead of using the string returned by read, it hallucinates a different string for oldString (e.g., if guess <<< secret secret secret_number {).
- The edit tool correctly returns an error: "Could not find oldString in the file."
- The model ignores this error and repeats the exact same incorrect edit call multiple times (10+ times) without updating the oldString to match the actual file content.
Expected Behavior:
The model should prioritize the output of the read tool and, upon receiving a "not found" error from the edit tool, it should re-examine the file content and correct the oldString parameter.
Actual Behavior:
The model ignores the tool's error message and persists in using a hallucinated string, resulting in an infinite loop of failed tool calls.
Environment:
- Model: gemma4-31b (local-vllm/gemma4-31b)
- Tool: edit
Plugins
No response
OpenCode version
1.3.14, 1.3.17, 1.4.0, 1.4.3
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Description
While using the edit tool to fix a simple syntax error in a Rust file, the model (gemma4-31b) entered a repetitive failure loop.
Steps to Reproduce:
Expected Behavior:
The model should prioritize the output of the read tool and, upon receiving a "not found" error from the edit tool, it should re-examine the file content and correct the oldString parameter.
Actual Behavior:
The model ignores the tool's error message and persists in using a hallucinated string, resulting in an infinite loop of failed tool calls.
Environment:
Plugins
No response
OpenCode version
1.3.14, 1.3.17, 1.4.0, 1.4.3
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response