From 2b3488315be3b6e5e50d8d0016ee61520cffa0f3 Mon Sep 17 00:00:00 2001 From: Ali Khokhar Date: Sun, 20 Sep 2026 13:26:19 -0700 Subject: [PATCH] Avoid unsupported server classifier notice in FCC Claude (#1847) ## Why Claude Code 2.1.278 warns that FCC cannot provide Anthropic's server-side auto-mode checks, even though its existing separate classifier requests still work. Fixes #1846. ## How Set `CLAUDE_CODE_AUTO_MODE_SERVER=0` in the shared FCC Claude environment, following [Anthropic's gateway guidance](https://code.claude.com/docs/en/auto-mode-classifier-billing). This keeps the existing classifier checks and avoids requesting unsupported server-side checks. It applies to launched Claude sessions and the VS Code integration, including automatic refresh of existing connections and removal on disconnect. Bump to 6.2.51. --- pyproject.toml | 2 +- src/free_claude_code/harnesses/claude.py | 2 ++ tests/cli/test_claude_launcher.py | 1 + tests/cli/test_entrypoints.py | 2 ++ tests/harnesses/test_claude_integration.py | 3 +++ tests/harnesses/test_integration_refresh.py | 1 + uv.lock | 2 +- 7 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e8a7a083ce..ab4078f908 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "free-claude-code" -version = "6.2.50" +version = "6.2.51" description = "Local proxy connecting coding agents to OpenAI-compatible AI providers" readme = "README.md" requires-python = ">=3.14.0" diff --git a/src/free_claude_code/harnesses/claude.py b/src/free_claude_code/harnesses/claude.py index 9540e161f9..e2698d9892 100644 --- a/src/free_claude_code/harnesses/claude.py +++ b/src/free_claude_code/harnesses/claude.py @@ -14,6 +14,8 @@ def claude_proxy_values(proxy_root_url: str, auth_token: str) -> dict[str, str]: "ANTHROPIC_BASE_URL": proxy_root_url, "ANTHROPIC_AUTH_TOKEN": auth_token, "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1", + # FCC uses Claude's separate classifier requests, not Anthropic server checks. + "CLAUDE_CODE_AUTO_MODE_SERVER": "0", "CLAUDE_CODE_DISABLE_ADVISOR_TOOL": "1", "CLAUDE_CODE_AUTO_COMPACT_WINDOW": CLAUDE_CODE_AUTO_COMPACT_WINDOW, "DISABLE_AUTOUPDATER": "1", diff --git a/tests/cli/test_claude_launcher.py b/tests/cli/test_claude_launcher.py index 5f5424c692..2afacba53e 100644 --- a/tests/cli/test_claude_launcher.py +++ b/tests/cli/test_claude_launcher.py @@ -28,3 +28,4 @@ def test_claude_owns_permission_selection( assert env["ANTHROPIC_AUTH_TOKEN"] == "launcher-test-token" assert env["CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY"] == "1" assert env["CLAUDE_CODE_DISABLE_ADVISOR_TOOL"] == "1" + assert env["CLAUDE_CODE_AUTO_MODE_SERVER"] == "0" diff --git a/tests/cli/test_entrypoints.py b/tests/cli/test_entrypoints.py index 5c4ede28a4..1b38fe8495 100644 --- a/tests/cli/test_entrypoints.py +++ b/tests/cli/test_entrypoints.py @@ -434,6 +434,7 @@ def test_claude_child_env_targets_current_proxy_config() -> None: "ANTHROPIC_AUTH_TOKEN": "old-token", "ANTHROPIC_API_KEY": "official-key", "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "0", + "CLAUDE_CODE_AUTO_MODE_SERVER": "1", "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1", "DISABLE_AUTOUPDATER": "0", "DISABLE_FEEDBACK_COMMAND": "0", @@ -446,6 +447,7 @@ def test_claude_child_env_targets_current_proxy_config() -> None: assert env["ANTHROPIC_BASE_URL"] == "http://127.0.0.1:9090" assert env["ANTHROPIC_AUTH_TOKEN"] == "proxy-token" assert env["CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY"] == "1" + assert env["CLAUDE_CODE_AUTO_MODE_SERVER"] == "0" assert env["CLAUDE_CODE_AUTO_COMPACT_WINDOW"] == "190000" assert env["DISABLE_AUTOUPDATER"] == "1" assert env["DISABLE_FEEDBACK_COMMAND"] == "1" diff --git a/tests/harnesses/test_claude_integration.py b/tests/harnesses/test_claude_integration.py index a7fd001543..9e3693f966 100644 --- a/tests/harnesses/test_claude_integration.py +++ b/tests/harnesses/test_claude_integration.py @@ -144,6 +144,7 @@ def test_connect_merges_jsonc_and_disconnect_preserves_unrelated_values(tmp_path {"name": "KEEP", "value": "yes"}, {"name": "ANTHROPIC_AUTH_TOKEN", "value": "old", "extra": "keep"}, {"name": "CLAUDE_CODE_DISABLE_ADVISOR_TOOL", "value": "0"}, + {"name": "CLAUDE_CODE_AUTO_MODE_SERVER", "value": "1"}, ], }""", encoding="utf-8", @@ -158,6 +159,7 @@ def test_connect_merges_jsonc_and_disconnect_preserves_unrelated_values(tmp_path "ANTHROPIC_AUTH_TOKEN", "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY", "CLAUDE_CODE_DISABLE_ADVISOR_TOOL", + "CLAUDE_CODE_AUTO_MODE_SERVER", "CLAUDE_CODE_AUTO_COMPACT_WINDOW", "DISABLE_AUTOUPDATER", "DISABLE_FEEDBACK_COMMAND", @@ -170,6 +172,7 @@ def test_connect_merges_jsonc_and_disconnect_preserves_unrelated_values(tmp_path } assert entries["CLAUDE_CODE_AUTO_COMPACT_WINDOW"]["value"] == "190000" assert entries["CLAUDE_CODE_DISABLE_ADVISOR_TOOL"]["value"] == "1" + assert entries["CLAUDE_CODE_AUTO_MODE_SERVER"]["value"] == "0" assert "//" not in path.read_text().replace("http://", "") assert operate(path, False) == {"connected": False} assert json.loads(path.read_text()) == { diff --git a/tests/harnesses/test_integration_refresh.py b/tests/harnesses/test_integration_refresh.py index 7fed88a9be..49b743b048 100644 --- a/tests/harnesses/test_integration_refresh.py +++ b/tests/harnesses/test_integration_refresh.py @@ -42,6 +42,7 @@ def test_refresh_upgrades_original_claude_directly_and_only_once(tmp_path): for entry in saved["claudeCode.environmentVariables"] } assert env["CLAUDE_CODE_DISABLE_ADVISOR_TOOL"] == "1" + assert env["CLAUDE_CODE_AUTO_MODE_SERVER"] == "0" assert env["KEEP_ME"] == "user-value" assert saved["editor.fontSize"] == 15 assert json.loads(state.read_text()) == { diff --git a/uv.lock b/uv.lock index 3586b6b58d..2ffe4f5198 100644 --- a/uv.lock +++ b/uv.lock @@ -599,7 +599,7 @@ wheels = [ [[package]] name = "free-claude-code" -version = "6.2.50" +version = "6.2.51" source = { editable = "." } dependencies = [ { name = "aiohttp" },