fix(frontend/builder): preserve agent name in AgentExecutor node title after reload

When an AgentExecutorBlock node was saved and the page reloaded, the
node title reverted to the generic "Agent Executor" because NodeHeader
always used data.title (the block name). This reads agent_name and
graph_version from hardcodedValues (persisted via input_default) and
uses them as the display title, falling back to data.title for
non-agent blocks.

Closes #11041
This commit is contained in:
Joe Munene
2026-04-15 22:16:35 +03:00
parent 2740b2be3a
commit f5ef508334

View File

@@ -21,7 +21,17 @@ type Props = {
export const NodeHeader = ({ data, nodeId }: Props) => {
const updateNodeData = useNodeStore((state) => state.updateNodeData);
const title = (data.metadata?.customized_name as string) || data.title;
const agentName = data.hardcodedValues?.agent_name as string | undefined;
const graphVersion = data.hardcodedValues?.graph_version as number | undefined;
const agentDisplayName =
agentName && graphVersion != null
? `${agentName} v${graphVersion}`
: agentName || undefined;
const title =
(data.metadata?.customized_name as string) ||
agentDisplayName ||
data.title;
const [isEditingTitle, setIsEditingTitle] = useState(false);
const [editedTitle, setEditedTitle] = useState(title);