Skip to content

Make Windows process diagnostics resilient to CIM timeouts #19

Description

@badcuban

Priority: P1

Why

Windows process diagnostics can time out and become a Diagnostics failure. The current Windows query shells out to PowerShell with a 1 second timeout and performs per-process CIM lookups, which is fragile under load.

Diagnostics evidence

From C:\Users\Will\.t3\userdata\logs\server.trace.ndjson* on May 26, 2026:

  • Recent failures included runProcess with ProcessDiagnosticsError: Failed to query process diagnostics. timed out.
  • The failures came from the process diagnostics path used by Settings -> Diagnostics.
  • apps/server/src/diagnostics/ProcessDiagnostics.ts sets PROCESS_QUERY_TIMEOUT_MS = 1_000 and readWindowsProcessRows() runs Get-CimInstance Win32_Process plus a per-process Get-CimInstance Win32_PerfFormattedData_PerfProc_Process lookup.

Acceptance criteria

  • Windows process diagnostics avoids per-process CIM calls or performs them in a batched/cheaper way.
  • The diagnostics page returns partial or cached process data instead of turning the whole read into a trace failure when CPU details are slow.
  • Timeout behavior is tuned for Windows machines under load.
  • Add Windows-focused coverage for timeout/partial-result behavior.

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