Skip to content

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

Open
jmagder wants to merge 6 commits intoanomalyco:devfrom
jmagder:fix-terminal-cpu-usage-web
Open

feat(web): fix(web): - Add FPS configuration for terminal to stop busy cycling (Issue #13899)#13901
jmagder wants to merge 6 commits intoanomalyco:devfrom
jmagder:fix-terminal-cpu-usage-web

Conversation

@jmagder
Copy link

@jmagder jmagder commented Feb 16, 2026

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.

@github-actions
Copy link
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
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.

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

1 participant