Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: auto-generate SubAgentFlow definitions for AI-created nodes#251

Merged
breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom
fix/subagentflow-auto-generationbreaking-brake/cc-wf-studio:fix/subagentflow-auto-generationCopy head branch name to clipboard
Dec 11, 2025
Merged

fix: auto-generate SubAgentFlow definitions for AI-created nodes#251
breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom
fix/subagentflow-auto-generationbreaking-brake/cc-wf-studio:fix/subagentflow-auto-generationCopy head branch name to clipboard

Conversation

@breaking-brake
Copy link
Copy Markdown
Owner

Problem

Current Behavior

  1. User creates a workflow using main workflow AI edit
  2. AI generates a SubAgentFlow node (reference)
  3. ❌ The corresponding SubAgentFlow definition (internal nodes/connections) is not created
  4. ❌ SubAgentFlow dialog cannot be opened ("Not linked" warning)

Expected Behavior

  1. User creates a workflow using main workflow AI edit
  2. AI generates a SubAgentFlow node (reference)
  3. ✅ The corresponding SubAgentFlow definition with internal structure is also created
  4. ✅ SubAgentFlow dialog opens normally

Solution

Implemented a hybrid approach to ensure SubAgentFlow definitions are always created:

  1. Primary: Extended workflow-schema.json with AI generation guidance to instruct AI to generate complete SubAgentFlow definitions
  2. Fallback: Added resolveSubAgentFlows post-processing to create minimal structures (Start → End) for any missing definitions

Changes

resources/workflow-schema.json

  • Added aiGenerationGuidance section to subAgentFlow node type
  • Added workflowStructure section documenting the subAgentFlows array field

src/extension/commands/ai-generation.ts

  • Added SubAgentFlow requirements to AI prompt
  • Added createMinimalSubAgentFlow() function
  • Added resolveSubAgentFlows() function for fallback processing

src/extension/utils/validate-workflow.ts

  • Added validateSubAgentFlowReferences() function for reference integrity checks

src/extension/services/refinement-service.ts

  • Added same resolveSubAgentFlows processing for AI refinement flow

src/webview/src/stores/workflow-store.ts

  • Updated addGeneratedWorkflow and updateWorkflow to handle subAgentFlows

Impact

  • SubAgentFlow nodes created via AI edit now have proper internal definitions
  • SubAgentFlow dialog opens correctly after AI generation
  • No breaking changes to existing workflows

Testing

  • Manual E2E testing completed
  • AI generates complete SubAgentFlow internal structure (not just Start→End)
  • SubAgentFlow dialog opens correctly
  • Code quality checks passed (format, lint, build)

🤖 Generated with Claude Code

- Extended workflow-schema.json with AI generation guidance for SubAgentFlow
- Added resolveSubAgentFlows fallback to create minimal Start→End structure
- Added validateSubAgentFlowReferences for reference integrity checks
- Updated workflow-store to handle subAgentFlows from generated workflows

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@breaking-brake breaking-brake merged commit 4ae3c43 into main Dec 11, 2025
3 checks passed
@breaking-brake breaking-brake deleted the fix/subagentflow-auto-generation branch December 11, 2025 01:24
@breaking-brake breaking-brake mentioned this pull request Dec 11, 2025
github-actions Bot added a commit that referenced this pull request Dec 11, 2025
## [3.5.4](v3.5.3...v3.5.4) (2025-12-11)

### Bug Fixes

* auto-generate SubAgentFlow definitions for AI-created nodes ([#251](#251)) ([4ae3c43](4ae3c43))
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.5.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.