mirror of
https://github.com/Comfy-Org/ComfyUI.git
synced 2026-08-26 19:02:36 +08:00
feat: register supports_terminal CLI feature flag
Add a registered, bool-typed supports_terminal flag so a terminal host (e.g. ComfyUI Desktop) can advertise interactive-terminal availability to the frontend via --feature-flag supports_terminal=true. Registration is required so the value coerces to a real boolean; the frontend gates the terminal UI on a strict === true check. Amp-Thread-ID: https://ampcode.com/threads/T-019e9464-f097-7430-a762-405ffb717dae Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -181,3 +181,12 @@ class TestCliFeatureFlagRegistry:
|
||||
assert "type" in info, f"{key} missing 'type'"
|
||||
assert "default" in info, f"{key} missing 'default'"
|
||||
assert "description" in info, f"{key} missing 'description'"
|
||||
|
||||
def test_supports_terminal_registered_as_bool(self):
|
||||
"""supports_terminal must be a registered bool so --feature-flag
|
||||
supports_terminal=true coerces to a real boolean. The frontend gates
|
||||
on a strict `=== true` check, so a raw string 'true' would not work."""
|
||||
assert "supports_terminal" in CLI_FEATURE_FLAG_REGISTRY
|
||||
assert CLI_FEATURE_FLAG_REGISTRY["supports_terminal"]["type"] == "bool"
|
||||
assert _coerce_flag_value("supports_terminal", "true") is True
|
||||
assert _coerce_flag_value("supports_terminal", "false") is False
|
||||
|
||||
Reference in New Issue
Block a user