fix: AI connection type propagation and get_node improvements (v2.28.1) (#461)

* fix: AI connection type propagation and get_node improvements (v2.28.1)

Bug fixes:
- Issue #458: addConnection now preserves AI connection types (ai_tool, ai_memory, ai_languageModel) instead of defaulting to 'main'
- Fixed false positive "AI Agent has no tools connected" validation warning

Enhancements:
- Added expectedFormat field to resourceLocator properties in get_node output
- Added versionNotice field to make typeVersion more prominent

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

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

Co-Authored-By: Claude <noreply@anthropic.com>

* test: add missing test coverage for PR #461 improvements

- Added test for AI Agent validation positive case (tools properly connected)
- Added 3 tests for expectedFormat on resourceLocator properties

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

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

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Romuald Członkowski
2025-12-01 18:54:15 +01:00
committed by GitHub
parent 33690c5650
commit 3188d209b7
9 changed files with 408 additions and 9 deletions

View File

@@ -1329,6 +1329,37 @@ describe('WorkflowValidator - Comprehensive Tests', () => {
expect(result.warnings.some(w => w.message.includes('AI Agent has no tools connected'))).toBe(true);
});
it('should NOT warn about AI agents WITH tools properly connected', async () => {
const workflow = {
nodes: [
{
id: '1',
name: 'Calculator Tool',
type: 'n8n-nodes-base.httpRequest',
position: [100, 100],
parameters: {}
},
{
id: '2',
name: 'Agent',
type: '@n8n/n8n-nodes-langchain.agent',
position: [300, 100],
parameters: {}
}
],
connections: {
'Calculator Tool': {
ai_tool: [[{ node: 'Agent', type: 'ai_tool', index: 0 }]]
}
}
} as any;
const result = await validator.validateWorkflow(workflow as any);
// Should NOT have warning about missing tools
expect(result.warnings.some(w => w.message.includes('AI Agent has no tools connected'))).toBe(false);
});
it('should suggest community package setting for AI tools', async () => {
const workflow = {
nodes: [