Feat: Remove the exception comment field from the agent form #3221 (#9153)

### What problem does this PR solve?
Feat: Remove the exception comment field from the agent form #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-08-01 15:19:33 +08:00
committed by GitHub
parent 4b98119c52
commit 2a79f4fc7f
7 changed files with 49 additions and 58 deletions

View File

@ -3,6 +3,7 @@ import { IAgentNode } from '@/interfaces/database/flow';
import { Handle, NodeProps, Position } from '@xyflow/react';
import { get } from 'lodash';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { AgentExceptionMethod, NodeHandleId } from '../../constant';
import useGraphStore from '../../store';
import { isBottomSubAgent } from '../../utils';
@ -20,6 +21,7 @@ function InnerAgentNode({
selected,
}: NodeProps<IAgentNode>) {
const edges = useGraphStore((state) => state.edges);
const { t } = useTranslation();
const isHeadAgent = useMemo(() => {
return !isBottomSubAgent(edges, id);
@ -87,9 +89,9 @@ function InnerAgentNode({
{(isGotoMethod ||
exceptionMethod === AgentExceptionMethod.Comment) && (
<div className="bg-background-card rounded-sm p-1 flex justify-between gap-2">
<span className="text-text-sub-title">Abnormal</span>
<span className="truncate flex-1">
{isGotoMethod ? 'Exception branch' : 'Output default value'}
<span className="text-text-sub-title">On Failure</span>
<span className="truncate flex-1 text-right">
{t(`flow.${exceptionMethod}`)}
</span>
</div>
)}