Skip to content

feat(web): fix(web): - Add FPS configuration for terminal to stop busy cycling (Issue #13899) - #13901

Closed
jmagder wants to merge 6 commits into
anomalyco:devfrom
jmagder:fix-terminal-cpu-usage-web
Closed

jmagder wants to merge 6 commits into
anomalyco:devfrom
jmagder:fix-terminal-cpu-usage-web

Conversation

@jmagder

@jmagder jmagder commented Feb 16, 2026 •

Copy link
Copy Markdown

What does this PR do?

This PR fixes #13899 and fixes #13817

When the terminal is loaded in the opencode web interface, my CPU cycles 100%. I traced this down to the terminal constantly requesting another animation frame. My monitor is 240hz so this used up an entire core forcing my computer into a higher power state.

This PR adds a new configurable setting via the web ux, to limit the max FPS of the terminal. I've set it to a default of 15 fps which uses negligible CPU. Setting it 0 uses the maximum frame rate. Anything else and it targets that frame rate.

I've added e2e tests to verify the settings are saved and applied to multiple terminals correctly.

Here is a screen shot of that UX:

image

Details of my analysis are in the original issue linked above.

Testing

  1. Goto a fresh opencode web instance without a terminal. Examine CPU usage in the terminal or use the chrome profiler.
  2. Open up the terminal. It should now be 15fps by default, and CPU usage should be minimal.
  3. Type in the terminal make sure it doesn't look lagy
  4. Open the settings and put it to 1fps, notice the terminal is laggy
  5. Change the fps to 240 (or 0) on a machine that can support that refresh rate and watch the CPU usage spike to 100%

How did you verify your code works?

I ran the testing described above, and added tests.

Profiler before changes:

Screenshot_20260216_142541

Profile after changes at 15 fps:

Screenshot_20260216_142448

@github-actions

Copy link
Copy Markdown
Contributor

Hey! Your PR title feat(web) / fix(web) - Add FPS configuration for terminal to stop busy cycling (Issue #13899) doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@jmagder jmagder changed the title feat(web) / fix(web) - Add FPS configuration for terminal to stop busy cycling (Issue #13899) feat(web): fix(web): - Add FPS configuration for terminal to stop busy cycling (Issue #13899) Feb 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@Hronom

Hronom commented Mar 11, 2026

Copy link
Copy Markdown

Please merge seems like it will help to solve high cpu usage

@jmagder

jmagder commented Mar 11, 2026

Copy link
Copy Markdown
Author

I'll rebase tomorrow, resolve the conflict and try to get some attention on this again.

@github-actions

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this May 10, 2026
@ForestJohnson

ForestJohnson commented May 23, 2026 •

Copy link
Copy Markdown

it looks like this was fixed in a different way in newest version of opencode...

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opencode Web - Terminal uses 100% CPU [FEATURE]: limit the FPS (frames per second) target rate, useful for remote work

3 participants