Skip to content

Severely laggy typing in chat input (contenteditable has ~500ms latency) #28162

Closed

Description

@halilang70-png

Description

Environment

  • OpenCode desktop app (Electron), Windows
  • CPU/GPU/memory all ~10% — not a hardware issue

Symptoms

Typing has ~500ms+ latency per keystroke. Pressing two keys rapidly
swallows the second. UI is unresponsive despite low resource usage.

Likely cause

The input uses <div contenteditable> instead of native <textarea>.
Combined with an unreconciled long conversation DOM tree, each keystroke
stalls the main thread on reflow/render.

Suggestion

  • Switch to native <textarea> for input
  • Add virtual scrolling for conversation history

Ps.Likely cause and Suggestion is made by opencode himself not me

Plugins

none

OpenCode version

1.15.4

Steps to reproduce

1.use open code electron app for a whole day
2.typing in conversation box become 不利索,even typing english with out chinese input. method I am using win11 en 23h2

Screenshot and/or share link

No response

Operating System

win11 23h2

Terminal

no therminal just opencode desktop electron app

Activity

  1. github-actions commented on May 18, 2026

    @github-actions
    Contributor

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

    If your issue is distinct, feel free to clarify what makes it different.

  2. behnammby commented on May 19, 2026

    @behnammby

    I'm using Linux Fedora 43, I have the same issue.
    Based on @halilang70-png suggestion, In production app, I changed input to textarea (via dev tools) and the delay was gone but the @mention styling was also gone as expected.

    However, There's no laggy typing when I run the desktop app in my chrome browser (from source code).

  3. halilang70-png commented on May 20, 2026

    @halilang70-png
    Author

    I'm using Linux Fedora 43, I have the same issue. Based on @halilang70-png suggestion, In production app, I changed input to textarea (via dev tools) and the delay was gone but the @mention styling was also gone as expected.

    However, There's no laggy typing when I run the desktop app in my chrome browser (from source code).

    They say it's the git, If a large change was made by ai agent ,the open code trying to scan the git DB so it become laggy,but how can I use an ai code agent without git, maybe this a asynch problem

  4. behnammby commented on May 20, 2026

    @behnammby

    I'm using Linux Fedora 43, I have the same issue. Based on @halilang70-png suggestion, In production app, I changed input to textarea (via dev tools) and the delay was gone but the @mention styling was also gone as expected.
    However, There's no laggy typing when I run the desktop app in my chrome browser (from source code).

    They say it's the git, If a large change was made by ai agent ,the open code trying to scan the git DB so it become laggy,but how can I use an ai code agent without git, maybe this a asynch problem

    I built an RPM file on my linux, then used this RPM to reinstall opencode desktop app.
    Now it's not laggy any longer when I use opencode on the same project which was laggy before.

    Give it a try. Solve the issue first, then we'll find the reason :-)

  5. behnammby commented on May 27, 2026

    @behnammby

    @halilang70-png I added this option to app settings so that I can disable electron hardware acceleration and the input delay decreased significantly.
    I think there might b some issues with electron hardware acceleration on some gpus too.

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