Skip to content

fix(controller): platform-aware process table, kill fallbacks, and install-job cancellation#211

Open
luminary19 wants to merge 1 commit into
sybil-solutions:mainfrom
luminary19:up/process-management
Open

fix(controller): platform-aware process table, kill fallbacks, and install-job cancellation#211
luminary19 wants to merge 1 commit into
sybil-solutions:mainfrom
luminary19:up/process-management

Conversation

@luminary19

Copy link
Copy Markdown
Contributor

Summary

Process discovery ran ps, kill fallbacks ran sudo -n kill, and install
cancel signalled only the direct child — all no-ops or leaks on Windows. The
process inventory now goes through a platform seam: Get-CimInstance Win32_Process (UTF-8, JSON) on win32, the existing ps path elsewhere, with
command lines tokenized by the shared quote-aware splitter instead of split on
spaces. Kill fallbacks use taskkill /PID <pid> /T /F on win32 and skip the
meaningless sudo attempt; install-job cancellation kills the child tree; the
running-process python probe reads the command line via CIM on Windows. POSIX
paths are unchanged. Fixes #210.

Validation

bun run typecheck and bun run lint clean; the new
parseWindowsProcessInventory unit test passes. Verified live on Windows 11
that listProcessInventory() returns the real CIM process table (377 processes,
correct pid/ppid, quoted command paths tokenized). The POSIX branch is
byte-identical to the previous listProcessInventory (Linux takes the unchanged
ps path), so CI is unaffected.

Note: the existing process-manager-spawn integration suite has Windows-only
fixture issues (extensionless fake binaries, a POSIX-shaped orphan-sweep
expectation) that are addressed by the separate test-portability PR; on Linux CI
that suite runs the unchanged POSIX path and passes.

UI changes

None.

Risks / rollout notes

  • CIM via PowerShell adds ~100-300ms per cold snapshot on win32 only; the
    snapshot is cached for the poll tick to avoid repeated forks.
  • taskkill /F is a hard kill — used only where SIGKILL was already the
    intent.

…stall-job cancellation

Read the process inventory from CIM (Get-CimInstance Win32_Process, UTF-8) on
Windows and from ps elsewhere, so orphan-worker discovery and docker-container
matching work cross-platform. Kill fallbacks use taskkill /T /F on win32 and
skip the meaningless sudo attempt; install-job cancellation kills the child
tree; the running-process python probe reads the command line via CIM and
tokenizes it with the shared quote-aware splitter. POSIX behavior is unchanged.
@luminary19
luminary19 requested a review from 0xSero as a code owner July 13, 2026 19:23
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.

[BUG] Process discovery and kill paths are POSIX-only — ps, sudo kill, and pgrep-style probes do nothing on Windows

1 participant