[PR #10252] fix: clarify LSP diagnostics output and add config to disable them #13374

Closed
opened 2026-02-16 18:18:14 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/10252

State: closed
Merged: No


Summary

  • Reword diagnostic messages in edit/write tool output to make it unambiguous that the operation succeeded, preventing agents from misinterpreting diagnostics as failed edits
  • Add a diagnostics.disabled config option so users can opt out of diagnostic output in tool results entirely

Problem

When an edit or write operation succeeds but triggers LSP diagnostics, the previous output only showed "LSP errors detected in this file, please fix:". This imperative wording caused agents to believe the operation failed, leading to unnecessary retries or infinite loops.

Changes

  1. Wording fix (edit.ts, write.ts): Changed output from "LSP errors detected in this file, please fix:" to "Note: the edit was applied successfully. The following pre-existing or new LSP diagnostics were detected in this file (informational only — not caused by a failed edit):"
  2. Config option (config.ts): Added diagnostics.disabled boolean option. When set to true in opencode.json, diagnostic output is completely suppressed from edit/write tool results:
    {
      "diagnostics": {
        "disabled": true
      }
    }
    
  3. Both tools now also skip diagnostic output when lsp: false is set (consistent with existing config)

Testing

  • Verified tsc --noEmit passes with no type errors
  • Full turbo typecheck passes across all packages
  • Manual testing: bun dev with edits triggering LSP diagnostics shows new wording

Fixes #9102

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/10252 **State:** closed **Merged:** No --- ## Summary - Reword diagnostic messages in edit/write tool output to make it unambiguous that the operation succeeded, preventing agents from misinterpreting diagnostics as failed edits - Add a `diagnostics.disabled` config option so users can opt out of diagnostic output in tool results entirely ## Problem When an edit or write operation succeeds but triggers LSP diagnostics, the previous output only showed `"LSP errors detected in this file, please fix:"`. This imperative wording caused agents to believe the operation failed, leading to unnecessary retries or infinite loops. ## Changes 1. **Wording fix** (`edit.ts`, `write.ts`): Changed output from `"LSP errors detected in this file, please fix:"` to `"Note: the edit was applied successfully. The following pre-existing or new LSP diagnostics were detected in this file (informational only — not caused by a failed edit):"` 2. **Config option** (`config.ts`): Added `diagnostics.disabled` boolean option. When set to `true` in `opencode.json`, diagnostic output is completely suppressed from edit/write tool results: ```json { "diagnostics": { "disabled": true } } ``` 3. Both tools now also skip diagnostic output when `lsp: false` is set (consistent with existing config) ## Testing - Verified `tsc --noEmit` passes with no type errors - Full `turbo typecheck` passes across all packages - Manual testing: `bun dev` with edits triggering LSP diagnostics shows new wording Fixes #9102
yindo added the pull-request label 2026-02-16 18:18:14 -05:00
yindo closed this issue 2026-02-16 18:18:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13374