Skip to content

fix(windows): find the host's scheduled task without administrator rights - #539

Merged
andrebrait merged 1 commit into
mainfrom
fix/windows-svchost-supervisor
Nov 19, 2026
Merged

andrebrait merged 1 commit into
mainfrom
fix/windows-svchost-supervisor

Conversation

@andrebrait

@andrebrait andrebrait commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #537.

On a Windows install without administrator rights, Win32_Process returns an empty ExecutablePath for SYSTEM processes such as svchost.exe. inspectWindowsSupervisor skipped Task Scheduler's svchost by its path only, so it kept that pid, matched the Schedule service to it and took the service, not the omp-web-host scheduled task, as the daemon's supervisor. The update then failed with not_controllable (access denied on Schedule).

  • Windows process rows now carry the process Name, which is readable for every process.
  • supervisorCandidatePids drops service hosts by name as well as by path.
  • A test runs on every platform with non-administrator rows (empty paths for SYSTEM processes).

Not changed: the WMI launch fallback in the issue's secondary note. The reporter traced that failure to their security product, and Win32_Process.Create already reports a non-zero ReturnValue.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where in-app updates on Windows installations without administrator rights could fail to identify the service supervising the host daemon. Updates can now recognize the service when Windows identifies its process by name rather than executable path. This helps ensure the update process can locate the correct service in these installations.

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Windows process inspection now records process names and excludes svchost.exe ancestors by name or executable path when selecting supervisor candidates. The added test covers empty executable paths and case-insensitive name matching. The changelog describes the non-administrator update failure.

Changes: Windows supervisor detection

Layer / File(s) Summary
Process name data
lib/upgrade-process.ts
ProcessInfo gains an optional process name. Windows process enumeration queries and returns Win32_Process.Name with the existing process fields.
Supervisor candidate filtering
lib/upgrade-process.ts, lib/upgrade-process.windows-service.test.mjs, CHANGELOG.md
The exported supervisorCandidatePids helper filters svchost.exe candidates by process name or executable path. The test covers missing paths and case-insensitive name matching. The changelog describes the Windows update issue.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

  • ompweb-dev/ompweb#538: Addresses the same Windows supervisor detection issue with an overlapping change to exclude service hosts by process name.
Merge Risk: Minimal · up to 27af6

This change makes in-app updates on non-administrator Windows installs identify the omp-web-host scheduled task instead of the Schedule service. The added test covers empty paths and case-insensitive name matching. No merge-blocking risk was found.

Security architecture risk: Minimal · up to 27af6

The fix recognizes shared Windows service hosts when their executable paths are unavailable. It preserves the existing permission, process-identity and supervisor-configuration checks. No introduced or worsened security or failure-containment risk was established.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the Windows fix and the scenario, but it says the fix finds "the host's scheduled task" when the changeset actually filters service-host processes (svchost.exe) by process name as well…
Linked Issues check Passed Issue #537 requires that the Windows supervisor inspection not resolve a task-scheduled daemon to the Schedule service when svchost.exe has an empty ExecutablePath. The head version of lib/upgra…
Out of Scope Changes check Passed All changed files relate to the #537 objective. lib/upgrade-process.ts adds the process name field and the name-aware supervisorCandidatePids helper used by Windows supervisor inspection. lib/upgrad…
Full details: Title check

Explanation

The title names the Windows fix and the scenario, but it says the fix finds "the host's scheduled task" when the changeset actually filters service-host processes (svchost.exe) by process name as well as path. The title is related to the main change and matches issue #537's expected behavior, so it is a partial but accurate match. It is not off-topic. The changelog entry and objectives describe the same Windows non-administrator supervisor detection fix.

Full details: Linked Issues check

Explanation

Issue #537 requires that the Windows supervisor inspection not resolve a task-scheduled daemon to the Schedule service when svchost.exe has an empty ExecutablePath. The head version of lib/upgrade-process.ts shows the Windows process query now returns Name = [string]$_.Name and maps it to ProcessInfo.name, so process names are available for every row. The PR summary states that the new exported supervisorCandidatePids drops service hosts by name as well as by path, that inspectWindowsSupervisor uses it, and that lib/upgrade-process.windows-service.test.mjs asserts exclusion of svchost.exe rows with empty paths on every platform. The issue's suggested fix matches this design. The secondary WMI launch fallback is explicitly not a claimed defect in #537, so it is not a requirement here. Limits: the two diff reads were unavailable and the file read was truncated before the supervisorCandidatePids body and its call site. The function body and test content are therefore assessed from the PR summary, not from source read at head.

Full details: Out of Scope Changes check

Explanation

All changed files relate to the #537 objective. lib/upgrade-process.ts adds the process name field and the name-aware supervisorCandidatePids helper used by Windows supervisor inspection. lib/upgrade-process.windows-service.test.mjs adds the regression test for empty-path svchost rows. CHANGELOG.md adds a Fixed entry for this change. No unrelated behavior change appears in the summary. The WMI launch fallback is not changed, which matches the PR description and the issue's non-defect note. Limit: the truncated read did not show the full changed hunks, so the absence of other edits rests on the PR summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2a6ab6e3-1ba0-4b99-ac27-0c5990698787
Commits

Reviewing files that changed from the base of the PR and between 8b8e2c1 and 27af65a.

Files selected for processing: 3

  • CHANGELOG.md
  • lib/upgrade-process.ts
  • lib/upgrade-process.windows-service.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@andrebrait

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-19T06:37:40.272798Z
We couldn’t complete this review. Comment @codex review to try again.
27af65a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@andrebrait
andrebrait merged commit 2176745 into main Nov 19, 2026
5 checks passed
@andrebrait
andrebrait deleted the fix/windows-svchost-supervisor branch November 19, 2026 06:40
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.

Windows: in-app update refuses with not_controllable — a task-scheduled daemon is misdetected as the Windows service 'Schedule'

1 participant