Skip to content

feat: give DynamicGroup refusals stable error codes - #1010

Closed
jaeone94 wants to merge 1 commit into
mainfrom
jaeone94/dynamic-group-error-codes
Closed

jaeone94 wants to merge 1 commit into
mainfrom
jaeone94/dynamic-group-error-codes

Conversation

@jaeone94

Copy link
Copy Markdown
Contributor

Part of CORE-186

Problem

DynamicGroup refusals from #973 reach the --json envelope under generic codes: workflow_edit_invalid, workflow_not_api_format, conversion_error, workflow_conversion_failed or workflow_slot_invalid. The only way to tell them apart is to match message text, which also contains node ids and field names. The cloud agent needs to count them by code.

Change

Four registered codes. Each one is a class attribute on DynamicGroupBindingError or one of its subclasses, so exception types stay ValueError, messages are unchanged, and existing except clauses still work.

Code Raised for
dynamic_group_unsupported (existing catalog warning, now also an error code) a schema the CLI refuses: bad bounds, a forced or dotted controller, an invalid template, defaultInput, a non-boolean control_after_generate, a duplicate or dotted field, a group inside a DynamicCombo, an unknown COMFY_DYNAMICGROUP_* version, a generated-name collision
dynamic_group_binding_mismatch saved values that do not bind to the schema: the row count or controller disagrees with the saved rows, widgets_values_form or widgets_values_named is malformed or mismatched, or a row's seed control mode is unsupported
dynamic_group_count_out_of_range a row-count write outside min..max, or not an integer
dynamic_group_rows_linked a shrink that would drop or shift a linked row input

The code shows up as error.code in:

  • set-widget, add-node, connect and the other edit commands;
  • workflow apply, including details.failed.code under --ack summary;
  • workflow foreach and workflow slots;
  • the conversion step of workflow validate, run and workflow decompose. WorkflowConversionError now takes an optional code.

The widget catalog keeps its existing dynamic_group_unsupported warning.

In the error-code registry test, engine.py stays excluded except for exception-class code attributes, and the test now also counts code=e.code or "fallback" literals.

Follow-ups: the row-replacement spec in Draft #1004 will use these codes once this lands, and the cloud agent will count them (a Comfy-Org/cloud follow-up).

Tests

  • New tests/comfy_cli/command/test_dynamic_group_error_codes.py: 16 CLI envelope cases cover each code across set-widget, apply (--ack summary), validate, slots, decompose, add-node and foreach. All 16 fail on main, where they get the generic codes, and pass on this branch.
  • ruff check, ruff format --check, full pytest: 9579 passed. 12 tests fail locally and also fail on main (PATH- and environment-dependent): agent/test_command.py ×5, test_code_search.py ×5, test_node_deps::test_non_pep440… and test_http::test_an_unloadable_supplement….

@jaeone94 jaeone94 self-assigned this Oct 14, 2026
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@jaeone94

jaeone94 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Closing this for now. Nothing consumes these codes yet, the cloud agent follow-up was never opened, and the branch is 63 commits behind main with conflicts. The refusals still work today under the generic codes and messages.

If a consumer shows up, I will reopen this aligned with the codes multi-player shipped in #283 (dynamic_group_count_out_of_range, dynamic_group_form_mismatch), so the same refusal has one code in both places. The "Part of CORE-186" reference above was also wrong.

@jaeone94 jaeone94 closed this Nov 1, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant