Skip to content

✨ feat(metadata): implement type checking for ComfyUI types#770

Open
claude[bot] wants to merge 1 commit intomainfrom
assistant/features-20260315-034228
Open

✨ feat(metadata): implement type checking for ComfyUI types#770
claude[bot] wants to merge 1 commit intomainfrom
assistant/features-20260315-034228

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Mar 15, 2026

Summary

Implements proper type validation for ComfyUI types (types starting with "comfy.") in the is_assignable function. Previously, all ComfyUI types were treated as universally assignable, which bypassed type safety checks and could lead to runtime errors.

Changes

  • src/nodetool/metadata/typecheck.py: Implemented type field validation for ComfyUI types
    • Dict values: checks value.get("type") == type_meta.type
    • Object instances: checks value.type == type_meta.type
    • Values without type information: returns False
  • tests/metadata/test_typecheck.py: Updated test to reflect new behavior
  • .github/opencode-memory/features.md: Added feature documentation

Test plan

  • All existing typecheck tests pass (25/25)
  • ComfyUI type assignability test updated and passing
  • Type checking validation passes
  • Linting passes

🤖 Generated with Claude Code

Implements proper type validation for ComfyUI types in the is_assignable
function. Previously, all ComfyUI types were treated as universally
assignable, which bypassed type safety checks.

The new implementation validates that:
- Dict values have a matching 'type' field
- Object instances have a matching 'type' attribute
- Values without type information are rejected

This improves type safety for ComfyUI workflows by ensuring only
compatible types are assignable during workflow validation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants