fix: enhance error output validation to detect incorrect configurations

- Add validateErrorOutputConfiguration method to detect when multiple nodes are incorrectly placed in main[0]
- Fix checkWorkflowPatterns to check main[1] for error outputs instead of outputs.error
- Cross-validate onError property matches actual connection structure
- Provide clear error messages with JSON examples showing correct configuration
- Use heuristic detection for error handler nodes (names containing error, fail, catch, etc.)
- Add comprehensive test coverage with 16+ test cases
- Bump version to 2.12.1

Fixes issues where AI agents would incorrectly configure error outputs by placing multiple nodes in the same array instead of separating them into success (main[0]) and error (main[1]) paths.

🤖 Generated with Claude Code (https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-09-22 21:05:27 +02:00
parent c5aebc1450
commit 1a926630b8
11 changed files with 3117 additions and 5 deletions

View File

@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [2.12.1] - 2025-09-22
### Fixed
- **Error Output Validation**: Enhanced workflow validator to detect incorrect error output configurations
- Detects when multiple nodes are incorrectly placed in the same output array (main[0])
- Validates that error handlers are properly connected to main[1] (error output) instead of main[0]
- Cross-validates onError property ('continueErrorOutput') matches actual connection structure
- Provides clear, actionable error messages with JSON examples showing correct configuration
- Uses heuristic detection for error handler nodes (names containing "error", "fail", "catch", etc.)
- Added comprehensive test coverage with 16+ test cases
### Improved
- **Validation Messages**: Error messages now include detailed JSON examples showing both incorrect and correct configurations
- **Pattern Detection**: Fixed `checkWorkflowPatterns` to check main[1] for error outputs instead of non-existent outputs.error
- **Test Coverage**: Added new test file `workflow-validator-error-outputs.test.ts` with extensive error output validation scenarios
## [2.12.0] - 2025-09-19
### Added