Skip to content

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

test(wrap): isolate two auth-precedence tests from the caller's ANTHROPIC_* env (#4601)

Kenneth Wong342c495ea5dd
diff --git a/tests/test_cli/test_wrap_claude_vertex_proxy_env.py b/tests/test_cli/test_wrap_claude_vertex_proxy_env.py
index 88dbaed2a..2279a1e26 100644
--- a/tests/test_cli/test_wrap_claude_vertex_proxy_env.py
+++ b/tests/test_cli/test_wrap_claude_vertex_proxy_env.py
@@ -158,6 +158,7 @@ def test_wrap_claude_plain_mode_api_key_auth_skips_remote_control_warning(
def test_wrap_claude_rejects_conflicting_auth_before_proxy_mutation(
runner: CliRunner, monkeypatch: pytest.MonkeyPatch, tmp_path: Path
) -> None:
+ _clear_claude_mode_env(monkeypatch)
monkeypatch.chdir(tmp_path)
user_settings = tmp_path / "user-settings.json"
user_settings.write_text('{"env":{"ANTHROPIC_AUTH_TOKEN":"token-value"}}', encoding="utf-8")
@@ -188,6 +189,7 @@ def test_wrap_claude_rejects_conflicting_auth_before_proxy_mutation(
def test_wrap_claude_includes_shared_project_settings_in_auth_precedence(
runner: CliRunner, monkeypatch: pytest.MonkeyPatch, tmp_path: Path
) -> None:
+ _clear_claude_mode_env(monkeypatch)
monkeypatch.chdir(tmp_path)
user_settings = tmp_path / "user-settings.json"
user_settings.write_text("{}", encoding="utf-8")