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 Hermes version parsing in the Windows installer (#1491)

Ali Khokhar40a314aa18a9
diff --git a/pyproject.toml b/pyproject.toml
index d851fdb5..ed3f2af5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "free-claude-code"
-version = "5.11.0"
+version = "5.11.1"
description = "Local proxy connecting coding agents to OpenAI-compatible AI providers"
readme = "README.md"
requires-python = ">=3.14.0"
diff --git a/scripts/install.ps1 b/scripts/install.ps1
index badf6b69..4ed7ef9d 100644
--- a/scripts/install.ps1
+++ b/scripts/install.ps1
@@ -866,11 +866,11 @@ function Get-HermesVersion {
param([string] $HermesPath)
$output = Invoke-Utf8NativeCapture -FilePath $HermesPath -Arguments @("--version")
- $version = Convert-SemanticVersionOutput $output
- if ([string]::IsNullOrWhiteSpace($version)) {
- throw "Hermes Agent is present, but 'hermes --version' did not return a valid semantic version."
+ if ($output -match '(?im)^\s*Hermes Agent\s+v?(?<version>\d+\.\d+\.\d+(?:[-+][0-9A-Za-z][0-9A-Za-z.-]*)?)(?=\s|$)') {
+ return $Matches["version"]
}
- return $version
+
+ throw "Hermes Agent is present, but 'hermes --version' did not return a valid semantic version."
}
function Confirm-HermesArchitecture {
diff --git a/tests/scripts/test_installers.py b/tests/scripts/test_installers.py
index 82b45983..ff458a59 100644
--- a/tests/scripts/test_installers.py
+++ b/tests/scripts/test_installers.py
@@ -1448,9 +1448,17 @@ def _batch_client(name: str) -> str:
"node": "22.19.0",
}.get(name, "1.0.0")
version_output = (
- f"Hermes Agent v{version} (test build)"
+ (
+ f'if "%1"=="--version" echo Hermes Agent v{version} '
+ "(2026.8.18) · upstream deadbeef\n"
+ 'if "%1"=="--version" echo Install directory: C:\\fake-hermes\n'
+ 'if "%1"=="--version" echo Install method: git\n'
+ 'if "%1"=="--version" echo Python: 3.12.11\n'
+ 'if "%1"=="--version" echo OpenAI SDK: 2.15.0\n'
+ 'if "%1"=="--version" echo Up to date'
+ )
if name == "hermes"
- else f"{name} {version}"
+ else f'if "%1"=="--version" echo {name} {version}'
)
help_output = (
"echo --extension, -e ^<path^> Load an extension\n"
@@ -1461,7 +1469,7 @@ def _batch_client(name: str) -> str:
return f"""@echo off
echo {name}:%*>>"%CALL_LOG%"
if "%FAIL_STEP%"=="{name}-verify" exit /b 51
-if "%1"=="--version" echo {version_output}
+{version_output}
if "%1"=="--help" (
{help_output}
)
@@ -1942,6 +1950,31 @@ def test_install_ps1_preserves_compatible_existing_hermes(
)
[email protected]("unrelated_version", ["3.12.11", "v3.12.11"])
+def test_install_ps1_rejects_unrelated_versions_in_hermes_output(
+ powershell_harness: PowerShellHarness,
+ unrelated_version: str,
+) -> None:
+ hermes_command = (
+ _batch_client("hermes")
+ .replace(
+ "echo Hermes Agent v0.20.4 (2026.8.18) · upstream deadbeef",
+ "echo Hermes Agent release unavailable",
+ )
+ .replace(
+ "echo Python: 3.12.11",
+ f"echo {unrelated_version}",
+ )
+ )
+ _write_executable(powershell_harness.bin_dir / "hermes.cmd", hermes_command)
+
+ result = powershell_harness.run()
+
+ assert result.returncode != 0
+ assert "did not return a valid semantic version" in result.stderr
+ assert not any(call.startswith("uv:") for call in powershell_harness.calls())
+
+
def test_install_ps1_preserves_compatible_existing_grok(
powershell_harness: PowerShellHarness,
) -> None:
diff --git a/uv.lock b/uv.lock
index 83f47c0f..5f3d91d4 100644
--- a/uv.lock
+++ b/uv.lock
@@ -607,7 +607,7 @@ wheels = [
[[package]]
name = "free-claude-code"
-version = "5.11.0"
+version = "5.11.1"
source = { editable = "." }
dependencies = [
{ name = "aiohttp" },