Skip to content

[Bug]: Fix Windows WMI polling overhead #4024

Description

@CodeZeno

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Start the desktop app (created using pnpm dist:desktop:win:x64)
  2. Open Task Manager > Details > Sort by CPU
  3. WmiPrvSE.exe has a high CPU usage (8% in my case)
  4. Open Event Viewer > Application and Services Logs > Microsoft > Windows > WMI-Activity > Operational
  5. Every 5 seconds there is a log like:
  6. Id = {A2EAAE71-1498-000C-097B-D9A39814DD01}; ClientMachine = USERSMACHINE; User = AzureAD\UsersName; ClientProcessId = 25212; Component = Core; Operation = Start IWbemServices::ExecQuery - root\cimv2 : SELECT * FROM Win32_PerfFormattedData_PerfProc_Process WHERE IDProcess = 0; ResultCode = 0x800706BA; PossibleCause = Could not send status to client
  7. Close T3 Code, events stop but WmiPrvSE.exe usage remains at 8%, nothing else on the system is causing the usage, seems T3 Code has caused WmiPrvSE.exe to be stuck in a degraded state.
  8. Running a command like Stop-Process -Id 5248 -Force fixes the issue but running and closing T3 Code again causes the issue to reappear.

Expected behavior

The polling should not cause repeated errors every 5 seconds, and not leave WmiPrvSE.exe in a degraded state.

Actual behavior

The polling constantly fails and leaves WmiPrvSE.exe in a degraded state, even after T3 Code is closed.

Impact

Major degradation or frequent failure

Version or commit

v0.0.29-nightly.20260715.816

Environment

Windows 11

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

I have a new branch that I have confirmed fixes the issue but I can't confirm it doesn't have other side effects so have not submitted as a PR: https://github.com/CodeZeno/t3code/tree/fix/windows-wmi-polling

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions