Feat: Insert the node data of the bottom subagent into the tool array of the head agent #3221 (#8471)

### What problem does this PR solve?

Feat: Insert the node data of the bottom subagent into the tool array of
the head agent #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-06-25 15:24:22 +08:00
committed by GitHub
parent 5256980ffb
commit ece27c66e9
2 changed files with 48 additions and 12 deletions

View File

@ -17,10 +17,11 @@ import { useContext, useMemo } from 'react';
import { useForm } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
import { z } from 'zod';
import { NodeHandleId, Operator, initialAgentValues } from '../../constant';
import { Operator, initialAgentValues } from '../../constant';
import { AgentInstanceContext } from '../../context';
import { INextOperatorForm } from '../../interface';
import useGraphStore from '../../store';
import { isBottomSubAgent } from '../../utils';
import { Output } from '../components/output';
import { PromptEditor } from '../components/prompt-editor';
import { AgentTools } from './agent-tools';
@ -57,10 +58,7 @@ const AgentForm = ({ node }: INextOperatorForm) => {
const defaultValues = useValues(node);
const isSubAgent = useMemo(() => {
const edge = edges.find(
(x) => x.target === node?.id && x.targetHandle === NodeHandleId.AgentTop,
);
return !!edge;
return isBottomSubAgent(edges, node?.id);
}, [edges, node?.id]);
const outputList = useMemo(() => {