Skip to content

High CPU usage #4804

Closed
Closed

Description

@shantur

Description

I use opencode on MacOS ( Intel ) and after sometime the CPU usage keeps increasing.
Even when session is idle, the CPU usage stays high.

My main usage is in 2 projects and I see the same behaviour in both.

  1. typescript, javascript, html app
  2. Dart / Flutter app

I don't use it anywhere else so not sure if this is related.

OpenCode version

1.0.110

Steps to reproduce

Unsure of the steps.
Just keep using opencode, switch sessions, fork sessions etc

Screenshot and/or share link

Image

Operating System

macOS 15.7.2

Terminal

iTerm2, CodeNomad

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 26, 2025
  2. github-actions commented on Nov 26, 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.

  3. added
    perfIndicates a performance issue or need for optimization
    on Nov 26, 2025
  4. thdxr commented on Nov 27, 2025

    @thdxr
    Member

    do you have permissions turned on?

  5. pablonification commented on Nov 27, 2025

    @pablonification

    happens to me too

  6. shantur commented on Nov 27, 2025

    @shantur
    ContributorAuthor

    do you have permissions turned on?

    No permissions aren't enabled in any of the projects

  7. andre-schaerpf commented on Dec 2, 2025

    @andre-schaerpf

    Just observed an agent running into this very issue on accident. Reproduction steps are as follows:

    • Asked an agent to implement some feature and trigger a build / compile afterwards.
    • Agent completed the implementation and compiled successfully, which caused our build output directory to fill up (and, due to a misconfiguration on my end, this directory is not in any .gitignore file or similar)
    • Agent noticed the huge amount of new files after checking git status and decided to remove them using rm -rf.
    • After freezing for about 30s, OpenCode's "Modified Files" sidebar started listing every single deleted file that previously existed in the now deleted directory. In this state, the TUI does not react to any key presses anymore and needs to be killed.

    I submitted #4963 to introduce pagination for this scenario.

  8. rekram1-node commented on Dec 2, 2025

    @rekram1-node
    Collaborator

    are you sure the issue was the sidebar rendering and not the diff checking? just curious

    Did you use btop to figure that out

  9. andre-schaerpf commented on Dec 2, 2025

    @andre-schaerpf

    The diff itself seems to be pretty fast - at least based on what I saw during debugging. I did not measure the timing though (also no btop).
    My first approach was to change the diff panel to be collapsed by default while leaving the diff logic itself unchanged. This immediately improved performance for me; at least until I manually expanded the panel again, which then caused a freeze as expected.

  10. rekram1-node commented on Dec 2, 2025

    @rekram1-node
    Collaborator

    Ahh okay good to know

  11. rekram1-node commented on Dec 2, 2025

    @rekram1-node
    Collaborator

    i'll take a look at the pr just wanted to make sure we address core issue

  12. paralin commented on Dec 2, 2025

    @paralin
    Contributor

    What I'm seeing is quite a bit different. If I tab away from the agent for a long time, then tab back, it's quite laggy - sometimes typing is very slow, and if I press enter it will send the message without everything I typed in there. And then it won't show the agent replying until some time later (after a delay). Often I Ctrl c out of open code then reopen it and go to the session to see that the agent indeed was working and I had just interrupted it midway due to the UI lag. Maybe opencode is trying to update the display constantly when nothing is changing (while tabbed out) and this all gets buffered somehow lagging out future updates? Just a guess.

  13. shantur commented on Dec 24, 2025

    @shantur
    ContributorAuthor

    This was Bun stderr bug present on macOS Sequoia

  14. shitastical commented on Jan 20, 2026

    @shitastical

    This is still an issue for me on linux.

  15. manascb1344 commented on Jan 30, 2026

    @manascb1344

    Yes, dont know why on linux its unusually HIGH!!

  16. Hronom commented on Mar 11, 2026

    @Hronom

    Same for me, version 1.2.24 desktop version. Ubuntu 24.04.4 LTS

  17. roccolycos commented on Mar 11, 2026

    @roccolycos

    Same on 1.2.24 in Ubuntu Server 24.04.4 LTS

  18. cloudmidleman commented on Mar 15, 2026

    @cloudmidleman

    same Ubuntu Server 24.04.4 LTS

  19. Hronom commented on Mar 24, 2026

    @Hronom

    Why this closed? Desktop version not usable at linux because of this. Not sure about CLI.
    Version 1.3.0, ubuntu 24.04.4 LTS

  20. chris-hatton commented on Mar 26, 2026

    @chris-hatton

    Issue remains on macOS 1.2.27!
    Terrible issue, MacBook just burning up during regular use for no reason.
    This is what happens when you make Desktop Apps with Web Technologies.

  21. DavidGOrtega commented on Jul 11, 2026

    @DavidGOrtega

    I feel the same pain... very high cpu use. I love opencode but Im willing ti find other alternatives

  22. douglangille commented on Aug 29, 2026

    @douglangille

    this issue is still live in 1.18.23.

    opencode-sample.txt

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

Metadata

Metadata

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentuiperfIndicates a performance issue or need for optimization

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions