From e72229741c8f2af03e8533ec000562878a6b95dc Mon Sep 17 00:00:00 2001 From: dante01yoon Date: Tue, 3 Nov 2026 13:22:00 -0500 Subject: [PATCH] Revert "Turn on local_web_sso and partner_node_token by default (#17490)" This reverts commit 1f22ffd176c5128e9fd71b3769ee4d671a005443. --- comfy_api/feature_flags.py | 20 ++++++++------------ tests-unit/feature_flags_test.py | 20 -------------------- 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/comfy_api/feature_flags.py b/comfy_api/feature_flags.py index 569a77c9977..6bc29ba9c03 100644 --- a/comfy_api/feature_flags.py +++ b/comfy_api/feature_flags.py @@ -37,12 +37,12 @@ class FeatureFlagInfo(TypedDict): }, "partner_node_token": { "type": "bool", - "default": True, + "default": False, "description": "Queue Local API-node prompts with a renewable partner-node token instead of the workspace token", }, "local_web_sso": { "type": "bool", - "default": True, + "default": False, "description": "Offer Sign in with browser (Cloud OAuth + PKCE) on Local ComfyUI opened at localhost or 127.0.0.1", }, } @@ -126,17 +126,13 @@ def _parse_cli_feature_flags() -> dict[str, Any]: # Owned by app.deploy_to_cloud, which sets it via set_server_feature. _SERVER_SET_FEATURE_FLAGS = ("deploy_to_cloud",) -def _server_feature_flags() -> dict[str, Any]: - """Registry defaults, then core flags, then CLI flags. CLI flags cannot overwrite core or server-set flags; main.py may still set "assets".""" - registry_defaults = {k: info["default"] for k, info in CLI_FEATURE_FLAG_REGISTRY.items()} - cli_flags = { - k: v for k, v in _parse_cli_feature_flags().items() - if k not in _CORE_FEATURE_FLAGS and k not in _SERVER_SET_FEATURE_FLAGS - } - return {**registry_defaults, **_CORE_FEATURE_FLAGS, **cli_flags} - +# CLI-provided flags cannot overwrite core or server-set flags. Startup code may: main.py sets "assets". +_cli_flags = { + k: v for k, v in _parse_cli_feature_flags().items() + if k not in _CORE_FEATURE_FLAGS and k not in _SERVER_SET_FEATURE_FLAGS +} -SERVER_FEATURE_FLAGS: dict[str, Any] = _server_feature_flags() +SERVER_FEATURE_FLAGS: dict[str, Any] = {**_CORE_FEATURE_FLAGS, **_cli_flags} def get_connection_feature( diff --git a/tests-unit/feature_flags_test.py b/tests-unit/feature_flags_test.py index b483a1b9cbb..d68b044e06b 100644 --- a/tests-unit/feature_flags_test.py +++ b/tests-unit/feature_flags_test.py @@ -10,7 +10,6 @@ SERVER_FEATURE_FLAGS, _coerce_flag_value, _parse_cli_feature_flags, - _server_feature_flags, ) from app.comfy_api_env import ( environment_overrides_for_base, @@ -194,25 +193,6 @@ def test_invalid_bool_value_dropped(self, monkeypatch, caplog): class TestCliFeatureFlagRegistry: """Test suite for the CLI feature flag registry.""" - @pytest.mark.parametrize("key", ["partner_node_token", "local_web_sso"]) - def test_local_sso_flags_are_on_by_default(self, key): - assert CLI_FEATURE_FLAG_REGISTRY[key]["default"] is True - - def test_server_features_report_registry_defaults(self, monkeypatch): - monkeypatch.setattr("comfy_api.feature_flags.args", type("Args", (), {"feature_flag": []})()) - features = _server_feature_flags() - for key, info in CLI_FEATURE_FLAG_REGISTRY.items(): - assert features[key] == info["default"], key - - @pytest.mark.parametrize("key", ["partner_node_token", "local_web_sso"]) - def test_cli_flag_turns_a_default_on_flag_off(self, monkeypatch, key): - monkeypatch.setattr("comfy_api.feature_flags.args", type("Args", (), {"feature_flag": [f"{key}=false"]})()) - assert _server_feature_flags()[key] is False - - def test_cli_flags_cannot_override_core_flags(self, monkeypatch): - monkeypatch.setattr("comfy_api.feature_flags.args", type("Args", (), {"feature_flag": ["node_replacements=false"]})()) - assert _server_feature_flags()["node_replacements"] is True - def test_registry_entries_have_required_fields(self): for key, info in CLI_FEATURE_FLAG_REGISTRY.items(): assert "type" in info, f"{key} missing 'type'"