opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Agents misinterpret LSP diagnostics as failed edits

Open Lyapsus opened this issue 3 days ago • 3 comments

When an edit or write operation succeeds but triggers LSP diagnostics (errors/warnings), the tool output only shows the diagnostics. This can lead agents to believe the operation failed, causing them to retry unnecessarily or get stuck in a loop.

The output should clearly indicate that the edit/write was applied successfully, even if diagnostics are present.

Lyapsus avatar Jan 17 '26 16:01 Lyapsus

This issue might be a duplicate of existing issues. Please check:

  • #6310: Sessions become unusable due to large LSP diagnostics (Lua + possibly others) - Similar problem where LSP diagnostics are causing issues with tool operations
  • #3902: File edits not applied - shows diff output only without modifying files - Shows similar symptom where edit operations appear to fail but may actually succeed
  • #2255: write and edit tools return spurious 'cmd must not be empty' error despite successful operations - Related issue where operations succeed but errors are shown, causing agents to misinterpret results

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Jan 17 '26 16:01 github-actions[bot]

It sounds a bit like a bad model issue. Had zero problems with that. Tool calls show clearly successful, agent interprets the type errors correctly, also understands when it's not due to that edit. What model are you using?

pschiel avatar Jan 17 '26 22:01 pschiel

Don't have transcripts at hand but I'm pretty sure Gemini 3 Pro and Codex 5.2 both at max thinking levels showed such behavior. And even if this is a matter of weak model - why not help it? This case is a free lunch to me in this regard

Lyapsus avatar Jan 17 '26 22:01 Lyapsus