diff --git a/tests/agent/test_auxiliary_config_bridge.py b/tests/agent/test_auxiliary_config_bridge.py index 66350519b0b..11fe9f71c23 100644 --- a/tests/agent/test_auxiliary_config_bridge.py +++ b/tests/agent/test_auxiliary_config_bridge.py @@ -200,7 +200,11 @@ class TestGatewayBridgeCodeParity: def test_gateway_has_auxiliary_bridge(self): """The gateway config bridge must include auxiliary.* bridging.""" gateway_path = Path(__file__).parent.parent.parent / "gateway" / "run.py" - content = gateway_path.read_text() + # Pin encoding to UTF-8: source files in this repo are UTF-8, but + # Path.read_text() defaults to the system locale — which is cp1252 + # on most Western Windows installs and crashes as soon as the file + # contains any non-ASCII byte (e.g. an em-dash in a comment). + content = gateway_path.read_text(encoding="utf-8") # Check for key patterns that indicate the bridge is present assert "AUXILIARY_VISION_PROVIDER" in content assert "AUXILIARY_VISION_MODEL" in content @@ -214,7 +218,9 @@ class TestGatewayBridgeCodeParity: def test_gateway_no_compression_env_bridge(self): """Gateway should NOT bridge compression config to env vars (config-only).""" gateway_path = Path(__file__).parent.parent.parent / "gateway" / "run.py" - content = gateway_path.read_text() + # See note in test_gateway_has_auxiliary_bridge — pin UTF-8 so the + # test runs on Windows where the default locale is cp1252. + content = gateway_path.read_text(encoding="utf-8") assert "CONTEXT_COMPRESSION_PROVIDER" not in content assert "CONTEXT_COMPRESSION_MODEL" not in content @@ -289,7 +295,9 @@ class TestCLIDefaultsHaveAuxiliaryKeys: # So auxiliary config from config.yaml gets merged even though # cli.py's defaults dict doesn't define it. import cli as _cli_mod - source = Path(_cli_mod.__file__).read_text() + # See note in test_gateway_has_auxiliary_bridge — pin UTF-8 so the + # test runs on Windows where the default locale is cp1252. + source = Path(_cli_mod.__file__).read_text(encoding="utf-8") assert "auxiliary_config = defaults.get(\"auxiliary\"" in source assert "AUXILIARY_VISION_PROVIDER" in source assert "AUXILIARY_VISION_MODEL" in source