continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.64k stars 1.72k forks source link

Latest version breaks re-focus with chat open #2752

Open lunatic-gh opened 1 month ago

lunatic-gh commented 1 month ago

Before submitting your bug report

Relevant environment info

- OS: Arch Linux (Hyprland)
- Continue version: 0.0.79
- IDE version: PyCharm 2024.2.4 Pro
- Model:LLama 3.1 8B
- config.json:

{
  "models": [
    {
      "title": "Llama 3.1 8B",
      "provider": "ollama",
      "model": "llama3.1:8b"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Starcoder 3b",
    "provider": "ollama",
    "model": "starcoder2:3b"
  },
  "customCommands": [
    {
      "name": "test",
      "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
      "description": "Write unit tests for highlighted code"
    }
  ],
  "contextProviders": [
    {
      "name": "diff",
      "params": {}
    },
    {
      "name": "folder",
      "params": {}
    },
    {
      "name": "codebase",
      "params": {}
    }
  ],
  "slashCommands": [
    {
      "name": "edit",
      "description": "Edit selected code"
    },
    {
      "name": "comment",
      "description": "Write comments for the selected code"
    },
    {
      "name": "share",
      "description": "Export the current chat session to markdown"
    },
    {
      "name": "commit",
      "description": "Generate a git commit message"
    }
  ],
  "embeddingsProvider": {
    "provider": "ollama",
    "model": "nomic-embed-text"
  }
}

Description

In the new version, it seems that whenever the chat is open, trying to focus anything in the ide (editor, file-browser, etc) causes a quick flicker and re-focuses the chat immediately.

This issue does not seem to be present in 0.0.78.

NOTE: This might be an issue with my Window Manager (Hyprland). It quite frequently causes issues with XWayland Apps, but since this does not happen in 0.0.78, i thought reporting it here might be the best idea. Apparently also happens on other DE's like KDE, see first reply.

To reproduce

Log output

[info] Starting Continue core...
[2024-10-31T15:30:34] [info] Starting Continue core... 
[2024-10-31T15:30:34] Setup 
[2024-10-31T15:30:34] Core started 
[2024-10-31T15:30:44] [info] Exiting Continue core...
bpauw commented 4 weeks ago

I'm also encountering this on debian 12 KDE XWayland with Rider

Vilsol commented 3 weeks ago

Encountering the same issue.

Continue 0.0.80
GNOME Shell 46.4
GoLand 2024.3 Beta (Build #GO-243.21565.42, built on October 31, 2024)
The X.Org Foundation Xwayland Version 24.1.3 (12401003)
X Protocol Version 11, Revision 0

Opening IDE in wayland mode and clicking on continue tab completely breaks everything. (https://blog.jetbrains.com/platform/2024/07/wayland-support-preview-in-2024-2/). Continue opens in a new window and makes it impossible to focus the IDE.

eliorc commented 2 weeks ago

This bug is stil present in 0.0.81

Jaizkibel commented 2 weeks ago

Does not seem to be a Wayland only error. I experience the same behavior on Linux Mint with nouveau driver

Plugin version 0.0.81

mphilippnv commented 2 weeks ago

I just tried 0.0.81 on Pycharm 2024.2.4 on Ubuntu 22.04 and same issue.

This is on xorg, not wayland.

sestinj commented 2 weeks ago

For everyone experiencing this, do you have the "Enable Off-Screen Rendering" option checked? I would recommend unchecking if so and reloading the window to see if this resolves it. That is (with 95% certainty) the change introduced that caused this behavior

Screenshot 2024-11-13 at 11 19 33 PM
pwuertz commented 2 weeks ago

I would recommend unchecking if so and reloading the window to see if this resolves it

On my affected system, off-screen rendering was initially unchecked.

I've now enabled off-screen rendering and the focus issue is gone. So this option seems to be connected to the issue, just the other way around?

eliorc commented 2 weeks ago

I would recommend unchecking if so and reloading the window to see if this resolves it

Just as @pwuertz I also had it unchecked. Checking it and restarting the IDE has solved the problem for me. But now I can't copy and paste, before that I could using right-click at least

mphilippnv commented 2 weeks ago

Mine was unchecked so I checked it then restarted IDE. This fixed the focus issue, but like eliorc, I was no longer able to paste content. So, I unchecked it and restarted IDE again and the focus issue came back.

sestinj commented 2 weeks ago

Got it, thanks everyone for the detail here. Everything I'm hearing confirms the hypothesis, so we'll get out a version later today with the fix.

Patrick-Erichsen commented 2 weeks ago

Hi all, thanks for your patience with this. I introduced this bug so apologies. It's been a bit of whack-a-mole resolving the issue as both the JetBrains & VS Code extensions have issues with certain meta keys, in certain file types, in certain environments, on certain operating systems :sweat_smile:

Other plugins have had similar issues with the specific setting in JetBrains that is requiring us to override certain meta keys, e.g. https://youtrack.jetbrains.com/issue/JBR-4407/Inside-JCEF-keyboard-events-on-Linux-have-the-wrong-code-set-and-are-not-recognized-in-the-web-view

However, this PR should now fix the copy/paste/cut bugs for non-MacOS users in JetBrains IDEs: https://github.com/continuedev/continue/pull/2936

It would be greatly appreciated if folks could install 0.0.82 from EAP and verify that things are working on your end: https://docs.continue.dev/troubleshooting#jetbrains-1e

lunatic-gh commented 2 weeks ago

I just tried 0.0.82.

Enabling "Enable Off-Screen Rendering" fixes the Focus-Issue for me, and the copy-paste bugs seem to be fixed now as well.

Patrick-Erichsen commented 2 weeks ago

Hi all, we're recommending folks downgrade to 0.0.75 at the moment. Please see this main issue for details: https://github.com/continuedev/continue/issues/2956