Skip to content

fix(install): make psutil a hard win32 dependency#72

Merged
pbean merged 5 commits into
bmad-code-org:mainfrom
dracic:fix/win32-psutil-hard-dep
Jul 9, 2026
Merged

fix(install): make psutil a hard win32 dependency#72
pbean merged 5 commits into
bmad-code-org:mainfrom
dracic:fix/win32-psutil-hard-dep

Conversation

@dracic

@dracic dracic commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What

Make psutil a platform-scoped core dependency (psutil>=7.2.2; sys_platform == 'win32') instead of an opt-in non-linux extra.

Why

On win32 psutil is load-bearing: WindowsProcessHost probes engine liveness/identity through it (no /proc, and os.kill(pid, 0) there is a destructive CTRL_C_EVENT). When it's absent probe_liveness() degrades to "unknown", so bmad-loop tui paints every run as ? regardless of actual state.

The default install path never pulled it — the bmad-loop-setup skill installs bmad-loop[tui], not [non-linux]. This marker makes pip, uv tool, and the setup skill all get psutil automatically on Windows. Linux stays dep-free; the non-linux extra remains the macOS opt-in.

Closes #71

Summary by CodeRabbit

  • Bug Fixes
    • Improved Windows setup by including an additional required dependency automatically on that platform.
    • Updated optional package notes to reflect platform-specific installation behavior more clearly.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@pbean, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 17 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ddf2c2f5-680e-4688-957a-ee37b481d4f0

📥 Commits

Reviewing files that changed from the base of the PR and between 7ddd4f4 and 13f9110.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • CHANGELOG.md
  • docs/game-engine-plugin-guide.md
  • docs/plugin-authoring-guide.md
  • pyproject.toml
  • src/bmad_loop/data/plugins/unity/unity_teardown.py
  • src/bmad_loop/process_host.py

Walkthrough

The psutil package is added as a Windows-conditional core dependency in pyproject.toml (sys_platform == 'win32'), alongside the existing pyyaml dependency. Comments in the tui optional-dependencies section are updated to reflect that Windows now gets psutil as a core dependency, while macOS remains an opt-in.

Changes

Dependency configuration update

Layer / File(s) Summary
Core and optional dependency updates
pyproject.toml
psutil is added to core dependencies conditionally for Windows (sys_platform == 'win32'), and the tui extra's comments are updated to describe the new dependency strategy, removing the older non-Linux/process-discovery comment.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Estimated code review effort: 1 (Trivial) | ~3 minutes

Poem

A rabbit hopped on Windows snow,
Found psutil finally ready to go,
No more ? marks in the TUI's face,
Just alive or dead, each run in place.
Hop, hop, hooray — dependencies flow! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: making psutil a Windows hard dependency.
Linked Issues check ✅ Passed The change matches #71 by moving psutil into a Windows-only core dependency while leaving Linux unchanged.
Out of Scope Changes check ✅ Passed The PR only updates dependency metadata and related comments, with no obvious unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

On Windows psutil is load-bearing, not optional: WindowsProcessHost probes
engine liveness/identity through it (no /proc, and os.kill(pid,0) is a
destructive CTRL_C_EVENT on win32). When it is absent every liveness read
degrades to "unknown" and the TUI paints every run as `?`.

It was only declared in the optional `non-linux` extra, which the default
install path (bmad-loop-setup's `[tui]`) never pulls. Promote it to a
platform-scoped core dependency so pip, uv tool, and the setup skill all get
it automatically on Windows; Linux stays dep-free and the extra remains the
macOS opt-in.

Closes bmad-code-org#71
@dracic dracic force-pushed the fix/win32-psutil-hard-dep branch from 7ddd4f4 to c247f8b Compare July 6, 2026 12:56
@augmentcode

augmentcode Bot commented Jul 6, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Makes psutil a Windows-only core dependency so win32 liveness/identity probing works reliably.
Changes: Adds a sys_platform == 'win32' dependency marker in pyproject.toml and clarifies the non-linux extra as macOS opt-in.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread pyproject.toml
dracic and others added 4 commits July 6, 2026 15:00
psutil is now a core dep on win32, so pointing Windows users at the optional
bmad-loop[non-linux] extra is misleading. Reword both _psutil() errors (and
their docstrings) to say "reinstall bmad-loop" on Windows and keep the extra
hint for macOS.

@pbean pbean left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated end-to-end — approving. The root-cause trace checks out exactly as described: WindowsProcessHost.is_alive depends entirely on psutil (process_host.py), probe_liveness() degrades a missing psutil to unknown, and the default install path (bmad-loop[tui] via the setup skill) never pulled the non-linux extra — so a stock Windows install genuinely paints every run ?. The sys_platform == 'win32' core-dep marker is the right shape: Linux stays dep-free, non-linux remains the macOS opt-in, and >=7.2.2 matches both the existing extra pin and the current PyPI latest.

I pushed three mechanical fix-ups to the branch (hope you don't mind):

  • uv.lock re-locked with a current uv — the lock had been regenerated with an older uv (schema revision = 31, all upload-time fields stripped, ~260 lines of churn that would flip back on the next maintainer uv lock). The lock diff vs main is now just the two psutil marker entries.
  • Merged main + CHANGELOG entry under [Unreleased] → Fixed.
  • Two docs aligned (docs/game-engine-plugin-guide.md, docs/plugin-authoring-guide.md) — both still described psutil as exclusively the opt-in non-linux extra, including on Windows.

Full test suite + trunk check green locally. Will squash-merge once CI re-greens. Thanks for the sharp diagnosis and the clean fix, @dracic!

@pbean pbean merged commit f33b086 into bmad-code-org:main Jul 9, 2026
9 checks passed
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: psutil should be a hard dependency, not an opt-in extra (TUI shows every run as ?)

2 participants