Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 1, 2025

Summary

Duplicates the uuid4_from_hash utility from ee/vellum_ee into ee/codegen as a TypeScript implementation. The utility is designed to skip generating the node_id attribute in Node Display classes when the UUID matches what would be generated from the node's definition module path and class name (matching the Python SDK's uuid4_from_hash(f"{node_class.__module__}.{node_class.__qualname__}") pattern).

Note: The node_id skipping check is currently commented out pending vembda-side fixes. The utility and tests are in place but disabled until those issues are resolved.

Review & Testing Checklist for Human

  • Verify the TypeScript uuid4FromHash implementation produces identical output to the Python uuid4_from_hash for the same inputs (tested with my_nodes.my_custom_node.MyCustomNode1be19097-e8d7-4acc-8bb5-2a99dc12dece)
  • Confirm the getNodeIdFromDefinition helper correctly handles undefined definitions by returning undefined
  • When vembda-side issues are resolved, unskip the tests and uncomment the check in base.ts

Notes

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Contributor

@dvargas92495 dvargas92495 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DevinAI add a snapshot test to generic-node.test.ts to show this in action

@devin-ai-integration
Copy link
Contributor Author

Added snapshot tests to generic-node.test.ts demonstrating the node_id skipping behavior:

  1. "should skip node_id when it matches hash" - Uses node ID 1be19097-e8d7-4acc-8bb5-2a99dc12dece which matches the hash of my_nodes.my_custom_node.MyCustomNode, so node_id is omitted from the display class
  2. "should include node_id when it does not match hash" - Uses node ID aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee which doesn't match, so node_id is included

Also fixed the implementation to use nodeData.definition.module and nodeData.definition.name (matching Python SDK's node_class.__module__ and node_class.__qualname__) instead of the generated module path.

* @param className - The class name
* @returns A UUID v4 string
*/
export function getNodeIdFromModuleAndName(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DevinAI update this helper to accept the full definition instead of forcing the consumer to split the fields

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed all feedback:

  1. Updated helper to accept full definition - Renamed getNodeIdFromModuleAndName to getNodeIdFromDefinition and updated it to accept the full definition object (with module and name properties) instead of separate fields

  2. Commented out the node_id check - The check in base.ts is now commented out with a TODO marker pending vembda-side fixes

  3. Skipped the tests - The describe block for node_id skipping tests is now using describe.skip with a TODO marker

definitionModule && definitionName
? getNodeIdFromModuleAndName(definitionModule, definitionName)
: undefined;
if (expectedNodeId === undefined || this.nodeData.id !== expectedNodeId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DevinAI comment out this check for now - there are some vembda-side problems we need to solve first

});
});

describe("node_id skipping when it matches hash-generated UUID", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DevinAI keep this test but skip it for now while we solve some issues on the vembda side

@devin-ai-integration devin-ai-integration bot changed the title Add uuid4FromHash utility to codegen and skip node_id when it matches hash-generated UUID Add uuid4FromHash utility to codegen (node_id skipping disabled pending vembda fix) Dec 14, 2025
@dvargas92495 dvargas92495 marked this pull request as ready for review December 14, 2025 23:58
@dvargas92495 dvargas92495 merged commit 3228cc7 into main Dec 14, 2025
9 checks passed
@dvargas92495 dvargas92495 deleted the devin/1764549545-uuid4-from-hash-codegen branch December 14, 2025 23:58
Copy link
Contributor

@NgoHarrison NgoHarrison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

3 participants