Skip to content

Run LSP only at session end only, asking to fix errors in a subsequent message #2536

Closed

Description

@remorses

LSP is way too aggressive. The LLM shouldn't need to fix errors after a single tool call, because most edits are expected to create an invalid file, for example when removing a variable in different places. The LSP adds too much noise to the LLM

Activity

  1. github-actions commented on Sep 10, 2025

    @github-actions
    Contributor

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

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

  2. divmgl commented on Sep 10, 2025

    @divmgl

    +1, this pollutes the context and confuses the agent nonstop

  3. NaikSoftware commented on Sep 12, 2025

    @NaikSoftware

    Mmm.. This is killer feature for me 😄 Other tools can use inexistent method or syntax. OpenCode always verifies after editing. If you expect errors and it's okay for you use case, you can instruct to ignore errors in the prompt. Its edge case in my opinion

  4. divmgl commented on Sep 13, 2025

    @divmgl

    It's not about expecting errors in our code. It's about surfacing errors in the right moment. Surfacing errors on every message does not improve agent behavior.

  5. remorses commented on Sep 13, 2025

    @remorses
    Author
  6. NaikSoftware commented on Sep 13, 2025

    @NaikSoftware

    It's not about expecting errors in our code. It's about surfacing errors in the right moment. Surfacing errors on every message does not improve agent behavior.

    depends on the case. In most cases I faced, when LLM goes wrong way, the problem should be fixed immediately. On the end of the session can be too late. Many changes have been made to the code and at the end we say "the entire flow was broken, do something with this". Imagine that you use API for creating app and at the end it turns out that such API doesn't exist.

  7. jbuckmccready commented on Nov 15, 2025

    @jbuckmccready

    I have found it adds a lot of noise/pollution to the context. The models are good enough now to mostly avoid creating compiler/language level errors when they make changes, and even when errors are made it quickly resolves them with a compile/type check after making changes.

    If not disabled by default maybe add to the config a way to disable all LSPs rather than having to disable each on a language by language basis.

    Here is an example just now when editing lua it thinks there's an error when there isn't (maybe due to lsp delay?) leading to the model then running a check only to realize there is no error ("Hmm, there's no error actually" followed by the Read tool use does not happen with lua LSP disabled):

      ┃                                                                                                                                         
      ┃  ← Edit nvim/.config/nvim/lua/plugins/sidekick.lua                                                                                      
      ┃                                                                                                                                         
      ┃   end,                                                                                                                                  
      ┃        desc = "Detach a CLI Session",                                                                                                   
      ┃    },                                                                                                                                   
      ┃    {                                                                                                                                    
      ┃   +    "az",                                                                                                                            
      ┃   +    function()                                                                                                                       
      ┃   +        require("sidekick.cli").hide()                                                                                               
      ┃   +    end,                                                                                                                             
      ┃   +    desc = "Hide CLI",                                                                                                               
      ┃   +},                                                                                                                                   
      ┃   +{                                                                                                                                    
      ┃        "<leader>aa",                                                                                                                    
      ┃        function()                                                                                                                       
      ┃            require("sidekick.cli").toggle({ name = "opencode", focus = true })                                                          
      ┃        end,                                                                                                                             
      ┃                                                                                                                                         
                                                                                                                                                
      ┃  Thinking: Let me read the file again to make sure I have the exact formatting right.                                                   
                                                                                                                                                
      ┃                                                                                                                                         
      ┃  # Check for Lua syntax errors                                                                                                          
      ┃                                                                                                                                         
      ┃  $ cd /Users/jbm/dotfiles/nvim/.config/nvim && nvim --headless -c "luafile lua/plugins/                                                 
      ┃  sidekick.lua" -c "quit" 2>&1                                                                                                           
      ┃                                                                                                                                         
                                                                                                                                                
      ┃  Thinking: Hmm, there's no error actually. Let me re-read the file to verify the edit was                                               
      ┃  applied.                                                                                                                               
                                                                                                                                                
         → Read nvim/.config/nvim/lua/plugins/sidekick.lua [offset=60, limit=20]                                                                
                                                                                                                                                
      ┃  Thinking: The edit was successfully applied! The new keymap az is now in the configuration                                             
      ┃  at lines 68-74, which will call require("sidekick.cli").hide() to hide the CLI.                                                        
                                                                                                                                                
         Done! Added az keymap to hide the CLI at line 68-74.                                                                                   
    
  8. ethan-huo commented on Jan 1, 2026

    @ethan-huo

    I agree this is a real pain point. The current behavior forces users to choose between:

    1. "lsp": false - lose all LSP features (hover, go-to-definition, etc.)
    2. Keep LSP enabled - deal with noisy inline diagnostics after every edit

    Suggestion: Add a config option like lsp.diagnostics.inline: boolean (default true to preserve current behavior). When set to false:

    • LSP servers still run, so hover/go-to-definition/references tools work
    • edit and write tools skip the LSP.touchFile() wait and diagnostics output

    This way agents can run bun typecheck or similar commands explicitly when they're ready, rather than being interrupted by incomplete-code errors mid-edit.

  9. rekram1-node commented on Jan 1, 2026

    @rekram1-node
    Collaborator

    @ethan-huo what LSP features would u be losing if u turned them off, the only thing that would stop working is the lsp tool and that's experimental so u prolly dont have it anyway

  10. ethan-huo commented on Jan 2, 2026

    @ethan-huo

    @ethan-huo what LSP features would u be losing if u turned them off, the only thing that would stop working is the lsp tool and that's experimental so u prolly dont have it anyway

    I set OPENCODE_EXPERIMENTAL_LSP_TOOL=true

  11. changed the title [-]Disable LSP by default. Or run it at session end only, asking to fix errors in a subsequent message[/-] [+]Run LSP only at session end only, asking to fix errors in a subsequent message[/+] on Jan 24, 2026
  12. github-actions commented on Mar 27, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions