Skip to content

Use Claude Code, Codex, VSCode, Pi, and OpenCode (and 6 other harnesses) for free (1.3B+ free tokens) from your terminal, app, IDE, or phone, and now from the browser with native browser sessions (multi-harness + multi-model) like OpenClaw (voice supported + ToS friendly)

Python

Fix Windows Muse installation with empty PATH entries (#1729)

Ali Khokhar81fa340ecac5
diff --git a/pyproject.toml b/pyproject.toml
index 06ac82ca..9795689f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "free-claude-code"
-version = "6.2.1"
+version = "6.2.2"
description = "Local proxy connecting coding agents to OpenAI-compatible AI providers"
readme = "README.md"
requires-python = ">=3.14.0"
diff --git a/scripts/install-muse.ps1 b/scripts/install-muse.ps1
index 4ba72b2d..ef4c2d30 100644
--- a/scripts/install-muse.ps1
+++ b/scripts/install-muse.ps1
@@ -222,7 +222,7 @@ function Read-MuseOwnershipRecord {
}
function Get-MuseCanonicalPath {
- param([Parameter(Mandatory = $true)][string] $Path)
+ param([Parameter(Mandatory = $true)][AllowEmptyString()][string] $Path)
if ([string]::IsNullOrWhiteSpace($Path)) {
return $null
diff --git a/scripts/uninstall-muse.ps1 b/scripts/uninstall-muse.ps1
index 8ec3106e..70f474eb 100644
--- a/scripts/uninstall-muse.ps1
+++ b/scripts/uninstall-muse.ps1
@@ -101,7 +101,7 @@ function Read-MuseOwnershipRecord {
}
function Get-MuseCanonicalPath {
- param([Parameter(Mandatory = $true)][string] $Path)
+ param([Parameter(Mandatory = $true)][AllowEmptyString()][string] $Path)
if ([string]::IsNullOrWhiteSpace($Path)) {
return $null
diff --git a/tests/scripts/test_muse_windows_lifecycle.py b/tests/scripts/test_muse_windows_lifecycle.py
index a0efd727..47de61bd 100644
--- a/tests/scripts/test_muse_windows_lifecycle.py
+++ b/tests/scripts/test_muse_windows_lifecycle.py
@@ -352,6 +352,7 @@ def _run_installer_lifecycle(
publish_failure: bool = False,
dry_run: bool = False,
install_root_is_file: bool = False,
+ empty_path_entries: bool = False,
) -> tuple[subprocess.CompletedProcess[str], Path, Path]:
local_app_data = tmp_path / "local-app-data"
if install_root_is_file:
@@ -370,6 +371,9 @@ def _run_installer_lifecycle(
user_path = os.pathsep.join(
(str(tmp_path / "user-one"), str(tmp_path / "user-two"))
)
+ if empty_path_entries:
+ process_path = os.pathsep + process_path + os.pathsep
+ user_path = os.pathsep + user_path + os.pathsep
script = f"""$ErrorActionPreference = 'Stop'
$env:LOCALAPPDATA = {_ps_literal(local_app_data)}
$env:Path = {_ps_literal(process_path)}
@@ -486,14 +490,16 @@ def test_muse_installer_rejects_file_at_managed_root_before_fetch(
@pytest.mark.parametrize("powershell", POWERSHELLS)
[email protected]("empty_path_entries", [False, True])
def test_muse_installer_publishes_verified_binary_record_and_path(
- tmp_path: Path, powershell: str
+ tmp_path: Path, powershell: str, empty_path_entries: bool
) -> None:
payload = b"fresh Muse payload"
result, local_app_data, call_log = _run_installer_lifecycle(
tmp_path,
powershell,
payload=payload,
+ empty_path_entries=empty_path_entries,
)
root, executable, record_path = _managed_paths(local_app_data)
@@ -503,8 +509,11 @@ def test_muse_installer_publishes_verified_binary_record_and_path(
payload
)
state = json.loads(result.stdout.splitlines()[-1])
- assert state["UserPath"].split(os.pathsep)[0] == str(root / "bin")
- assert state["ProcessPath"].split(os.pathsep)[0] == str(root / "bin")
+ for field, prefix in (("UserPath", "user"), ("ProcessPath", "process")):
+ expected = [str(tmp_path / f"{prefix}-one"), str(tmp_path / f"{prefix}-two")]
+ if empty_path_entries:
+ expected = ["", *expected, ""]
+ assert state[field] == os.pathsep.join([str(root / "bin"), *expected])
assert call_log.read_text(encoding="utf-8").splitlines() == [
"metadata",
"download",
@@ -799,8 +808,9 @@ def _create_managed_install(
@pytest.mark.parametrize("powershell", POWERSHELLS)
[email protected]("empty_path_entries", [False, True])
def test_muse_uninstaller_removes_only_managed_assets_and_exact_path_entries(
- tmp_path: Path, powershell: str
+ tmp_path: Path, powershell: str, empty_path_entries: bool
) -> None:
local_app_data = tmp_path / "local-app-data"
root, executable, record_path = _create_managed_install(local_app_data)
@@ -808,7 +818,13 @@ def test_muse_uninstaller_removes_only_managed_assets_and_exact_path_entries(
muse_state.parent.mkdir(parents=True)
muse_state.write_text('{"native":true}', encoding="utf-8")
- result, _ = _run_uninstaller_lifecycle(tmp_path, powershell)
+ path_entries = [str(tmp_path / "one"), str(tmp_path / "two")]
+ if empty_path_entries:
+ path_entries = ["", *path_entries, "", ""]
+ user_path = os.pathsep.join(
+ [str(root / "bin"), *path_entries, str(root / "bin") + os.sep]
+ )
+ result, _ = _run_uninstaller_lifecycle(tmp_path, powershell, user_path=user_path)
assert result.returncode == 0, result.stderr
assert not executable.exists()
@@ -816,7 +832,7 @@ def test_muse_uninstaller_removes_only_managed_assets_and_exact_path_entries(
assert not root.exists()
assert muse_state.read_text(encoding="utf-8") == '{"native":true}'
state = json.loads(result.stdout.splitlines()[-1])
- expected_path = os.pathsep.join((str(tmp_path / "one"), str(tmp_path / "two")))
+ expected_path = os.pathsep.join(path_entries)
assert state == {
"UserPath": expected_path,
"ProcessPath": expected_path,
diff --git a/uv.lock b/uv.lock
index 0f521c77..b2248fb5 100644
--- a/uv.lock
+++ b/uv.lock
@@ -598,7 +598,7 @@ wheels = [
[[package]]
name = "free-claude-code"
-version = "6.2.1"
+version = "6.2.2"
source = { editable = "." }
dependencies = [
{ name = "aiohttp" },