mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-24 23:48:42 +08:00
fix(ai-builder): Updating stream recursion limit and removing tool node static parameter validation (#23023)
This commit is contained in:
@@ -51,3 +51,6 @@ export const MAX_NODE_EXAMPLE_CHARS = 5000 * AVG_CHARS_PER_TOKEN_ANTHROPIC;
|
||||
export const MAX_BUILDER_ITERATIONS = 30;
|
||||
export const MAX_CONFIGURATOR_ITERATIONS = 30;
|
||||
export const MAX_DISCOVERY_ITERATIONS = 50;
|
||||
export const MAX_MULTI_AGENT_STREAM_ITERATIONS =
|
||||
MAX_BUILDER_ITERATIONS + MAX_CONFIGURATOR_ITERATIONS + MAX_DISCOVERY_ITERATIONS;
|
||||
export const MAX_SINGLE_AGENT_STREAM_ITERATIONS = 50;
|
||||
|
||||
@@ -3,7 +3,6 @@ import type { INodeTypeDescription } from 'n8n-workflow';
|
||||
import type { SimpleWorkflow } from '@/types';
|
||||
|
||||
import type { SingleEvaluatorResult } from '../types';
|
||||
import { nodeParametersContainExpression } from '../utils/expressions';
|
||||
import { isTool } from '../utils/is-tool';
|
||||
|
||||
const toolsWithoutParameters = [
|
||||
@@ -39,16 +38,6 @@ export function validateTools(
|
||||
description: `Tool node "${node.name}" has no parameters set.`,
|
||||
pointsDeducted: 20,
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!nodeParametersContainExpression(node.parameters)) {
|
||||
violations.push({
|
||||
name: 'tool-node-static-parameters',
|
||||
type: 'major',
|
||||
description: `Tool node "${node.name}" has no expressions in its parameters. This likely means it is not using dynamic input.`,
|
||||
pointsDeducted: 20,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ export type ProgrammaticViolationType = 'critical' | 'major' | 'minor';
|
||||
|
||||
export const PROGRAMMATIC_VIOLATION_NAMES = [
|
||||
'tool-node-has-no-parameters',
|
||||
// this validation has been removed for now as it was throwing a lot of false positives
|
||||
'tool-node-static-parameters',
|
||||
'agent-static-prompt',
|
||||
'agent-no-system-prompt',
|
||||
|
||||
@@ -18,6 +18,8 @@ import {
|
||||
DEFAULT_AUTO_COMPACT_THRESHOLD_TOKENS,
|
||||
MAX_AI_BUILDER_PROMPT_LENGTH,
|
||||
MAX_INPUT_TOKENS,
|
||||
MAX_MULTI_AGENT_STREAM_ITERATIONS,
|
||||
MAX_SINGLE_AGENT_STREAM_ITERATIONS,
|
||||
} from '@/constants';
|
||||
import { createMainAgentPrompt } from '@/prompts/legacy-agent.prompt';
|
||||
import { trimWorkflowJSON } from '@/utils/trim-workflow-context';
|
||||
@@ -515,7 +517,9 @@ export class WorkflowBuilderAgent {
|
||||
const streamConfig = {
|
||||
...threadConfig,
|
||||
streamMode: ['updates', 'custom'] as const,
|
||||
recursionLimit: 50,
|
||||
recursionLimit: payload.featureFlags?.multiAgent
|
||||
? MAX_MULTI_AGENT_STREAM_ITERATIONS
|
||||
: MAX_SINGLE_AGENT_STREAM_ITERATIONS,
|
||||
signal: abortSignal,
|
||||
callbacks: this.tracer ? [this.tracer] : undefined,
|
||||
metadata: this.runMetadata,
|
||||
|
||||
Reference in New Issue
Block a user