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
Enable uv malware checks on every CI runner (#1177)
Ali Khokhar776a6a4c5f2a
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.ymlindex 4660574a..1429f366 100644--- a/.github/workflows/tests.yml+++ b/.github/workflows/tests.yml@@ -5,6 +5,10 @@name: CI+env:+ UV_MALWARE_CHECK: "1"+ UV_PREVIEW_FEATURES: "malware-check"+on:push:branches: [main, master]@@ -66,7 +70,7 @@ jobs:- name: Install uvuses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39with:- version: "0.11.15"+ version: "0.11.16"enable-cache: truecache-python: truediff --git a/pyproject.toml b/pyproject.tomlindex 5b913422..bd6c32fb 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "hatchling.build"[project]name = "free-claude-code"-version = "4.8.5"+version = "4.8.6"description = "Local proxy connecting coding agents to OpenAI-compatible AI providers"readme = "README.md"requires-python = ">=3.14.0"@@ -53,7 +53,7 @@ packages = ["src/free_claude_code"]".env.example" = "free_claude_code/config/env.example"[tool.uv]-required-version = ">=0.11.0"+required-version = ">=0.11.16"[tool.uv.sources]torch = { index = "pytorch-cu130" }diff --git a/scripts/install.ps1 b/scripts/install.ps1index 6f73b1bb..88da2540 100644--- a/scripts/install.ps1+++ b/scripts/install.ps1@@ -15,7 +15,7 @@ $ProgressPreference = "SilentlyContinue"$RepoArchiveUrl = "https://github.com/Alishahryar1/free-claude-code/archive/refs/heads/main.zip"$PythonVersion = "3.14.0"-$MinUvVersion = "0.11.0"+$MinUvVersion = "0.11.16"$ClaudeInstallUrl = "https://claude.ai/install.ps1"$CodexInstallUrl = "https://chatgpt.com/codex/install.ps1"$PiInstallUrl = "https://pi.dev/install.ps1"@@ -355,17 +355,23 @@ function Get-UvVersion {return $version}-function Test-UvVersionAtLeast {+function Test-SupportedUvVersion {param([string] $Version,[string] $Minimum)- $normalizedVersion = (Convert-UvVersionOutput $Version) -replace '[-+].*$', ''- $normalizedMinimum = (Convert-UvVersionOutput $Minimum) -replace '[-+].*$', ''- if ([string]::IsNullOrWhiteSpace($normalizedVersion) -or [string]::IsNullOrWhiteSpace($normalizedMinimum)) {+ $parsedVersion = Convert-UvVersionOutput $Version+ $parsedMinimum = Convert-UvVersionOutput $Minimum+ if ([string]::IsNullOrWhiteSpace($parsedVersion) -or [string]::IsNullOrWhiteSpace($parsedMinimum)) {throw "Unable to compare uv versions."}+ if ($parsedVersion.Contains("-")) {+ return $false+ }++ $normalizedVersion = $parsedVersion -replace '\+.*$', ''+ $normalizedMinimum = $parsedMinimum -replace '\+.*$', ''return ([version] $normalizedVersion) -ge ([version] $normalizedMinimum)}@@ -382,8 +388,8 @@ function Confirm-Uv {}$version = Get-UvVersion $uvCommand.Source- if (-not (Test-UvVersionAtLeast -Version $version -Minimum $MinUvVersion)) {- throw "uv $MinUvVersion or newer is required; found uv $version after installation."+ if (-not (Test-SupportedUvVersion -Version $version -Minimum $MinUvVersion)) {+ throw "Stable uv $MinUvVersion or newer is required; found uv $version after installation."}Write-Host "Verified uv $version."}@@ -405,11 +411,11 @@ function Ensure-Uv {$uvCommand = Get-ApplicationCommand "uv"if ($uvCommand) {$version = Get-UvVersion $uvCommand.Source- if (Test-UvVersionAtLeast -Version $version -Minimum $MinUvVersion) {+ if (Test-SupportedUvVersion -Version $version -Minimum $MinUvVersion) {Write-Host "uv $version already satisfies >=$MinUvVersion; leaving it unchanged."return}- Write-Host "uv $version is below $MinUvVersion; installing the current standalone uv."+ Write-Host "uv $version does not satisfy stable >=$MinUvVersion; installing the current standalone uv."}else {Write-Host "uv is not installed; installing the current standalone uv."diff --git a/scripts/install.sh b/scripts/install.shindex 1196f1b9..3ee85951 100644--- a/scripts/install.sh+++ b/scripts/install.sh@@ -3,7 +3,7 @@ set -euREPO_ARCHIVE_URL="https://github.com/Alishahryar1/free-claude-code/archive/refs/heads/main.zip"PYTHON_VERSION="3.14.0"-MIN_UV_VERSION="0.11.0"+MIN_UV_VERSION="0.11.16"CLAUDE_INSTALL_URL="https://claude.ai/install.sh"CODEX_INSTALL_URL="https://chatgpt.com/codex/install.sh"PI_INSTALL_URL="https://pi.dev/install.sh"@@ -281,9 +281,13 @@ current_uv_version() {esac}-version_ge() {- current=${1%%[-+]*}- minimum=${2%%[-+]*}+uv_version_is_supported() {+ case "$1" in+ *-*) return 1 ;;+ esac++ current=${1%%+*}+ minimum=${2%%+*}old_ifs=$IFSIFS=.@@ -316,8 +320,8 @@ verify_uv() {command -v uv >/dev/null 2>&1 || fail "uv was installed, but it is not available on PATH."version=$(current_uv_version) || fail "uv is present, but 'uv --version' did not return a valid version."- if ! version_ge "$version" "$MIN_UV_VERSION"; then- fail "uv $MIN_UV_VERSION or newer is required; found uv $version after installation."+ if ! uv_version_is_supported "$version" "$MIN_UV_VERSION"; then+ fail "Stable uv $MIN_UV_VERSION or newer is required; found uv $version after installation."fiprintf 'Verified uv %s.\n' "$version"@@ -338,11 +342,11 @@ ensure_uv() {if command -v uv >/dev/null 2>&1; thenversion=$(current_uv_version) || fail "uv is present, but 'uv --version' did not return a valid version."- if version_ge "$version" "$MIN_UV_VERSION"; then+ if uv_version_is_supported "$version" "$MIN_UV_VERSION"; thenprintf 'uv %s already satisfies >=%s; leaving it unchanged.\n' "$version" "$MIN_UV_VERSION"return 0fi- printf 'uv %s is below %s; installing the current standalone uv.\n' "$version" "$MIN_UV_VERSION"+ printf 'uv %s does not satisfy stable >=%s; installing the current standalone uv.\n' "$version" "$MIN_UV_VERSION"elseprintf 'uv is not installed; installing the current standalone uv.\n'fidiff --git a/tests/contracts/test_uv_policy.py b/tests/contracts/test_uv_policy.pynew file mode 100644index 00000000..478abf37--- /dev/null+++ b/tests/contracts/test_uv_policy.py@@ -0,0 +1,26 @@+import tomllib+from pathlib import Path++UV_MINIMUM = "0.11.16"+++def test_supported_uv_minimum_is_consistent() -> None:+ pyproject = tomllib.loads(Path("pyproject.toml").read_text(encoding="utf-8"))+ install_sh = Path("scripts/install.sh").read_text(encoding="utf-8")+ install_ps1 = Path("scripts/install.ps1").read_text(encoding="utf-8")+ workflow = Path(".github/workflows/tests.yml").read_text(encoding="utf-8")++ assert pyproject["tool"]["uv"]["required-version"] == f">={UV_MINIMUM}"+ assert f'MIN_UV_VERSION="{UV_MINIMUM}"' in install_sh+ assert f'$MinUvVersion = "{UV_MINIMUM}"' in install_ps1+ assert f'version: "{UV_MINIMUM}"' in workflow+++def test_every_ci_job_inherits_uv_malware_check() -> None:+ workflow = Path(".github/workflows/tests.yml").read_text(encoding="utf-8")+ workflow_env = (+ 'env:\n UV_MALWARE_CHECK: "1"\n UV_PREVIEW_FEATURES: "malware-check"\n'+ )++ assert workflow.count(workflow_env) == 1+ assert workflow.index(workflow_env) < workflow.index("jobs:\n")diff --git a/tests/scripts/test_installers.py b/tests/scripts/test_installers.pyindex b4030a97..7c800523 100644--- a/tests/scripts/test_installers.py+++ b/tests/scripts/test_installers.py@@ -294,13 +294,15 @@ def test_install_sh_fresh_install_is_verified(posix_harness: PosixHarness) -> No][email protected]("uv_version", ("0.11.16", "0.11.16+build.1"))def test_install_sh_preserves_valid_existing_tools(posix_harness: PosixHarness,+ uv_version: str,) -> None:posix_harness.add_client("claude")posix_harness.add_client("codex")posix_harness.add_client("pi")- posix_harness.add_uv("0.11.7")+ posix_harness.add_uv(uv_version)result = posix_harness.run()@@ -315,7 +317,7 @@ def test_install_sh_replaces_unrelated_pi_command(posix_harness.add_client("claude")posix_harness.add_client("codex")posix_harness.add_unrelated_pi()- posix_harness.add_uv("0.11.7")+ posix_harness.add_uv("0.11.16")result = posix_harness.run()@@ -330,7 +332,7 @@ def test_install_sh_discovers_custom_pi_npm_prefix(posix_harness.add_client("claude")posix_harness.add_client("codex")posix_harness.add_npm_prefix(posix_harness.root / "custom-npm")- posix_harness.add_uv("0.11.7")+ posix_harness.add_uv("0.11.16")result = posix_harness.run()@@ -350,7 +352,24 @@ def test_install_sh_replaces_obsolete_uv(posix_harness: PosixHarness) -> None:result = posix_harness.run()assert result.returncode == 0, result.stderr- assert "uv 0.5.9 is below 0.11.0" in result.stdout+ assert "uv 0.5.9 does not satisfy stable >=0.11.16" in result.stdout+ assert "uv-install" in posix_harness.calls()++[email protected]("version", ("0.11.16-alpha.1", "0.12.0-rc.1"))+def test_install_sh_replaces_prerelease_uv(+ posix_harness: PosixHarness,+ version: str,+) -> None:+ posix_harness.add_client("claude")+ posix_harness.add_client("codex")+ posix_harness.add_client("pi")+ posix_harness.add_uv(version)++ result = posix_harness.run()++ assert result.returncode == 0, result.stderr+ assert f"uv {version} does not satisfy stable >=0.11.16" in result.stdoutassert "uv-install" in posix_harness.calls()@@ -741,13 +760,15 @@ def test_install_ps1_fresh_install_is_verified(][email protected]("uv_version", ("0.11.16", "0.11.16+build.1"))def test_install_ps1_preserves_valid_existing_tools(powershell_harness: PowerShellHarness,+ uv_version: str,) -> None:powershell_harness.add_client("claude")powershell_harness.add_client("codex")powershell_harness.add_client("pi")- powershell_harness.add_uv("0.11.7")+ powershell_harness.add_uv(uv_version)result = powershell_harness.run()@@ -762,7 +783,7 @@ def test_install_ps1_replaces_unrelated_pi_command(powershell_harness.add_client("claude")powershell_harness.add_client("codex")powershell_harness.add_unrelated_pi()- powershell_harness.add_uv("0.11.7")+ powershell_harness.add_uv("0.11.16")result = powershell_harness.run()@@ -777,7 +798,7 @@ def test_install_ps1_discovers_custom_pi_npm_prefix(powershell_harness.add_client("claude")powershell_harness.add_client("codex")powershell_harness.add_npm_prefix(powershell_harness.root / "custom-npm")- powershell_harness.add_uv("0.11.7")+ powershell_harness.add_uv("0.11.16")result = powershell_harness.run()@@ -799,7 +820,24 @@ def test_install_ps1_replaces_obsolete_uv(result = powershell_harness.run()assert result.returncode == 0, result.stderr- assert "uv 0.5.9 is below 0.11.0" in result.stdout+ assert "uv 0.5.9 does not satisfy stable >=0.11.16" in result.stdout+ assert "uv-install" in powershell_harness.calls()++[email protected]("version", ("0.11.16-alpha.1", "0.12.0-rc.1"))+def test_install_ps1_replaces_prerelease_uv(+ powershell_harness: PowerShellHarness,+ version: str,+) -> None:+ powershell_harness.add_client("claude")+ powershell_harness.add_client("codex")+ powershell_harness.add_client("pi")+ powershell_harness.add_uv(version)++ result = powershell_harness.run()++ assert result.returncode == 0, result.stderr+ assert f"uv {version} does not satisfy stable >=0.11.16" in result.stdoutassert "uv-install" in powershell_harness.calls()diff --git a/uv.lock b/uv.lockindex 540d8a37..6d49a2b0 100644--- a/uv.lock+++ b/uv.lock@@ -570,7 +570,7 @@ wheels = [[[package]]name = "free-claude-code"-version = "4.8.5"+version = "4.8.6"source = { editable = "." }dependencies = [{ name = "aiohttp" },