Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Nov 25, 2025

Fixes class name collision in codegen when a node in a subworkflow has the same name as the outer inline subworkflow node. The nested workflow class name was bypassing the shared classNames registry, so now it uses getUniqueClassName() + addUsedClassName() to ensure uniqueness.

Review & Testing Checklist for Human

  • Verify this fixes the APO-2207 scenario by creating a workflow where an inline subworkflow node (e.g., "My Node") contains an internal node with a name that would collide with the workflow class (e.g., "My Node Workflow"), then run codegen and confirm distinct class names are generated
  • Confirm the naming behavior is acceptable: when there's a collision, the internal node gets renamed (e.g., MyNodeWorkflow1), not the nested workflow class
  • Check if there are other places in codegen that generate class names without going through the uniqueness registry

Notes

When generating nested workflow contexts for inline subworkflow nodes,
the nested workflow class name was created using createPythonClassName()
directly without checking for collisions with existing class names.

This caused issues when a node in a subworkflow had the same name as the
outer inline subworkflow node, resulting in identical CodeResourceDefinition
values for both the base node class and the nested workflow class.

This fix uses workflowContext.getUniqueClassName() and addUsedClassName()
to ensure nested workflow class names are unique within the shared classNames
registry, similar to how node class names are handled.

Co-Authored-By: [email protected] <[email protected]>
@vellum-automation
Copy link
Contributor

@codex review

@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

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Tests that when an internal node has the same name as what the nested
workflow class would be named, the nested workflow class gets a unique
name. This verifies the fix in nested-workflow-base.ts that uses
getUniqueClassName() instead of createPythonClassName() directly.

Co-Authored-By: [email protected] <[email protected]>
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.

2 participants