From d4c1524dc12b9bd29e02145fae2c1852bba2caf9 Mon Sep 17 00:00:00 2001 From: Vinh Trinh Date: Thu, 5 Nov 2026 02:08:01 -0500 Subject: [PATCH 1/2] fix(errors): keep the workflow save and delete warnings out of the error-code registry --- comfy_cli/error_codes.py | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/comfy_cli/error_codes.py b/comfy_cli/error_codes.py index 0690acc0e..5f5357992 100644 --- a/comfy_cli/error_codes.py +++ b/comfy_cli/error_codes.py @@ -976,40 +976,6 @@ class ErrorCode: "still succeeds.", "drop `--description`; a sidebar file carries only its name and contents", ), - ErrorCode( - "workspace_unknown", - "`comfy workflow save` wrote to a Comfy Cloud Workflows-sidebar folder, but Cloud did not say which " - "workspace it went to, so `data.url` leaves out the workspace and deployment and opens the folder in " - "whatever workspace the browser is on. Surfaced in `data.warnings[]` (not as an error envelope) " - "because the save itself succeeded.", - "switch the browser to the workspace `comfy cloud whoami` shows before opening the link", - ), - ErrorCode( - "workflow_record_unknown", - "`comfy workflow save` wrote to a Comfy Cloud Workflows-sidebar folder, but Cloud did not show the " - "workflow record it makes from that file, so `data.workflow_id` and `data.latest_version` are null. " - "Surfaced in `data.warnings[]` (not as an error envelope) because the file itself was saved.", - "find the record with `comfy --json workflow list --name `", - ), - ErrorCode( - "api_format_saved_as_record", - "`comfy workflow save` on a Comfy Cloud workspace that saves into Workflows-sidebar folders was given " - "an API-format workflow. The sidebar opens files as editor graphs and would show it empty, so it was " - "saved the record-only way, with no folder and no `data.url`. Surfaced in `data.warnings[]` (not as an " - "error envelope) because the record save succeeded.", - "save the editor format (ComfyUI `File > Save`) to get a sidebar folder and a link", - ), - ErrorCode( - "sidebar_file_kept", - "`comfy workflow delete` on a Comfy Cloud workspace with `cli_cloud_save_enabled` on deleted the " - "workflow record, but the Workflows-sidebar file the record was made from (`filename` in the " - "warning) still exists. The file counts as the record's only when the record is the one live " - "workflow of its name and the file matches the record's latest version; a file that only shares the " - "name may be another workflow's, and gets no warning. The CLI never deletes sidebar files, so it " - "stays in the sidebar. Surfaced in `data.warnings[]` (not as an error envelope) because the record " - "delete succeeded.", - "remove the file from the Workflows sidebar in Comfy Cloud", - ), ErrorCode( "cql_query_invalid", "Grammar query failed to parse or evaluate.", From dddeb5fd482e5528ef759a37901818df28cd14ac Mon Sep 17 00:00:00 2001 From: Vinh Trinh Date: Thu, 5 Nov 2026 02:16:50 -0500 Subject: [PATCH 2/2] fix(errors): keep the sidebar warning codes registered and list them as legacy warning registrations --- comfy_cli/error_codes.py | 34 +++++++++++++++++++ .../output/test_error_code_registry.py | 9 +++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/comfy_cli/error_codes.py b/comfy_cli/error_codes.py index 5f5357992..0690acc0e 100644 --- a/comfy_cli/error_codes.py +++ b/comfy_cli/error_codes.py @@ -976,6 +976,40 @@ class ErrorCode: "still succeeds.", "drop `--description`; a sidebar file carries only its name and contents", ), + ErrorCode( + "workspace_unknown", + "`comfy workflow save` wrote to a Comfy Cloud Workflows-sidebar folder, but Cloud did not say which " + "workspace it went to, so `data.url` leaves out the workspace and deployment and opens the folder in " + "whatever workspace the browser is on. Surfaced in `data.warnings[]` (not as an error envelope) " + "because the save itself succeeded.", + "switch the browser to the workspace `comfy cloud whoami` shows before opening the link", + ), + ErrorCode( + "workflow_record_unknown", + "`comfy workflow save` wrote to a Comfy Cloud Workflows-sidebar folder, but Cloud did not show the " + "workflow record it makes from that file, so `data.workflow_id` and `data.latest_version` are null. " + "Surfaced in `data.warnings[]` (not as an error envelope) because the file itself was saved.", + "find the record with `comfy --json workflow list --name `", + ), + ErrorCode( + "api_format_saved_as_record", + "`comfy workflow save` on a Comfy Cloud workspace that saves into Workflows-sidebar folders was given " + "an API-format workflow. The sidebar opens files as editor graphs and would show it empty, so it was " + "saved the record-only way, with no folder and no `data.url`. Surfaced in `data.warnings[]` (not as an " + "error envelope) because the record save succeeded.", + "save the editor format (ComfyUI `File > Save`) to get a sidebar folder and a link", + ), + ErrorCode( + "sidebar_file_kept", + "`comfy workflow delete` on a Comfy Cloud workspace with `cli_cloud_save_enabled` on deleted the " + "workflow record, but the Workflows-sidebar file the record was made from (`filename` in the " + "warning) still exists. The file counts as the record's only when the record is the one live " + "workflow of its name and the file matches the record's latest version; a file that only shares the " + "name may be another workflow's, and gets no warning. The CLI never deletes sidebar files, so it " + "stays in the sidebar. Surfaced in `data.warnings[]` (not as an error envelope) because the record " + "delete succeeded.", + "remove the file from the Workflows sidebar in Comfy Cloud", + ), ErrorCode( "cql_query_invalid", "Grammar query failed to parse or evaluate.", diff --git a/tests/comfy_cli/output/test_error_code_registry.py b/tests/comfy_cli/output/test_error_code_registry.py index 0931d4df2..ffbb58536 100644 --- a/tests/comfy_cli/output/test_error_code_registry.py +++ b/tests/comfy_cli/output/test_error_code_registry.py @@ -229,10 +229,12 @@ def _collect_codes() -> tuple[dict[str, list[Path]], dict[str, list[Path]]]: #: Warning-only codes registered before warnings were kept out of the error #: registry. They stay registered because registered codes are append-only; -#: no code joins this list. A new warning keeps its code in ``warnings[]`` -#: and is not registered. +#: the ``workflow save``/``delete`` sidebar warnings joined because they were +#: registered just before the rule landed. No other code joins this list. A +#: new warning keeps its code in ``warnings[]`` and is not registered. LEGACY_WARNING_REGISTRATIONS = frozenset( { + "api_format_saved_as_record", "description_ignored", "dynamic_group_unsupported", "installed_versions_unavailable", @@ -244,9 +246,12 @@ def _collect_codes() -> tuple[dict[str, list[Path]], dict[str, list[Path]]]: "registry_no_dependency_metadata", "registry_partial_dependency_metadata", "select_no_match", + "sidebar_file_kept", "ui_only_link_dropped", "ui_only_node_skipped", "workflow_content_not_json", + "workflow_record_unknown", + "workspace_unknown", } )