mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user