Skip to content

fix(cli): make fle cluster work on Windows - #438

Open
JimmyL83 wants to merge 1 commit into
JackHopkins:mainfrom
JimmyL83:fix/cluster-cli-windows
Open

JimmyL83 wants to merge 1 commit into
JackHopkins:mainfrom
JimmyL83:fix/cluster-cli-windows

Conversation

@JimmyL83

Copy link
Copy Markdown

Problem

On Windows, fle cluster start crashes before doing anything:

File "fle/run.py", line 41, in fle_cluster
    subprocess.run(cmd, cwd=str(cluster_path), check=True)
OSError: [WinError 193] %1 is not a valid Win32 application

fle_cluster() executes fle/cluster/run-envs.sh directly, and Windows can't run a bash script that way.

Fix

On Windows (os.name == "nt"), fle cluster now uses the Python ClusterManager in fle/cluster/run_envs.py. That's the same manager fle inspect-eval already uses to auto-start servers. It supports start, stop, restart and help, with the same defaults as run-envs.sh (1 instance, default_lab_scenario) and the same validation (1–33 instances, open_world or default_lab_scenario).

Linux and macOS keep using run-envs.sh unchanged, so behaviour there doesn't change.

Testing

  • New tests/unit/test_cluster_cli.py (8 tests, no Docker or server needed). It stubs ClusterManager and checks that the script is never executed on Windows.
  • Manually on Windows 11 with Docker Desktop and Python 3.12: fle cluster help, fle cluster stop, fle cluster start -n 1 -s open_world (the server comes up and FLE connects over RCON), and fle cluster start -s bogus (exits 1 with an error).
  • pre-commit (ruff check and format) passes on the changed files.

🤖 Generated with Claude Code

`fle cluster` executes fle/cluster/run-envs.sh directly, which fails on
Windows with `OSError: [WinError 193] %1 is not a valid Win32 application`.

On Windows the command now goes through the Python ClusterManager in
fle/cluster/run_envs.py, the same manager `fle inspect-eval` already uses
to auto-start servers. start/stop/restart/help are supported, with the
same defaults (1 instance, default_lab_scenario) and validation (1-33
instances, known scenarios) as run-envs.sh. Linux and macOS keep using
the script unchanged.

Adds server-free unit tests with a stubbed ClusterManager.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant