Skip to content

feat: support Windows processes in mcp_client #1765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 0 commits into from
Closed

Conversation

cwoolum
Copy link
Collaborator

@cwoolum cwoolum commented May 10, 2025

Cross-Platform Process Management for Windows Support

This PR adds cross-platform process management capabilities to support Windows in the Amazon Q Developer CLI. It addresses build issues that were occurring on Windows due to Unix-specific code.

Changes

Process Information Module

  • Added from_raw method to the Pid struct for consistent process ID handling across platforms
  • Implemented platform-specific terminate_process functions in their respective OS modules:
    • Uses kill with SIGTERM on Unix platforms (Linux and macOS)
    • UsesWindows API to kill processes on Windows platforms
  • Updated module exports to properly expose platform-specific implementations

MCP Client

  • Made process_group method conditional on Unix platforms
  • Updated process termination to use the cross-platform terminate_process function
  • Added fig_util as a dependency to mcp_client

Testing

  • Verified that the code builds successfully on Windows

Continues work on #153

@@ -10,6 +12,11 @@ use super::{
PidExt,
};

pub fn terminate_process(pid: Pid) -> Result<(), String> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I duplicated this code for Unix and macOS since there are individual files for each OS. Not in love with it but it felt more cohesive than doing the OS specific logic in mod.rs.

@codecov-commenter
Copy link

codecov-commenter commented May 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 16.75%. Comparing base (029f760) to head (a69178b).
Report is 25 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1765   +/-   ##
=======================================
  Coverage   16.75%   16.75%           
=======================================
  Files         213      213           
  Lines       20704    20704           
  Branches      871      871           
=======================================
  Hits         3468     3468           
  Misses      17236    17236           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cwoolum cwoolum changed the title feat: support windows processes in mcp_client feat: support Windows processes in mcp_client May 10, 2025
@cwoolum cwoolum changed the title feat: support Windows processes in mcp_client feat: support Windows processes in mcp_client May 10, 2025
@cwoolum cwoolum force-pushed the main branch 4 times, most recently from 288ce1b to e468ffd Compare May 12, 2025 18:11
@cwoolum cwoolum marked this pull request as ready for review May 12, 2025 19:04
@cwoolum cwoolum force-pushed the main branch 3 times, most recently from 488926b to 5aea911 Compare May 13, 2025 16:34
@@ -64,6 +64,7 @@ dialoguer = { version = "0.11.0", features = ["fuzzy-select"] }
dirs = "5.0.0"
eyre = "0.6.8"
fd-lock = "4.0.4"
fig_util.workspace = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't add fig_util as a chat-cli dependency, instead update whatever is required to support Windows inside what we have in chat-cli

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.

3 participants