From 6907d44810fc53fe5160c189a4a11d20c85388ed Mon Sep 17 00:00:00 2001 From: Brian Madison Date: Sat, 22 Nov 2025 17:26:46 -0600 Subject: [PATCH] fix: display proper persona names in custom agent manifests ## Problem Custom agents showed generic names (like "Commit Poet") instead of their actual persona names (like "Inkwell Von Comitizen") in the agent manifest. ## Root Cause The extractManifestData function was using metadata.name/title instead of extracting the persona name from the compiled agent XML. ## Solution 1. Added extractAgentAttribute function to pull attributes from tag 2. Prioritize XML extraction over metadata for persona info: - displayName: uses agent title attribute from XML - title: uses agent title attribute from XML - icon: uses agent icon attribute from XML - Falls back to metadata if XML extraction fails ## Result Custom agents now display their actual persona names in manifests: - Before: "Commit Poet" - After: "Inkwell Von Comitizen" This provides better user experience with proper agent identification in IDE integrations and manifests. --- tools/cli/installers/lib/core/installer.js | 1 - tools/cli/lib/agent/installer.js | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/cli/installers/lib/core/installer.js b/tools/cli/installers/lib/core/installer.js index 186ab2a7..4124f5d8 100644 --- a/tools/cli/installers/lib/core/installer.js +++ b/tools/cli/installers/lib/core/installer.js @@ -2371,7 +2371,6 @@ class Installer { if (await fs.pathExists(manifestFile)) { const manifestData = extractManifestData(xml, { ...metadata, name: finalAgentName }, relativePath, 'custom'); manifestData.name = finalAgentName; - manifestData.displayName = metadata.name || finalAgentName; manifestData.path = relativePath; addToManifest(manifestFile, manifestData); } diff --git a/tools/cli/lib/agent/installer.js b/tools/cli/lib/agent/installer.js index be9a4a96..7e3b364d 100644 --- a/tools/cli/lib/agent/installer.js +++ b/tools/cli/lib/agent/installer.js @@ -677,6 +677,12 @@ function extractManifestData(xmlContent, metadata, agentPath, moduleName = 'cust return match[1].trim().replaceAll(/\n+/g, ' ').replaceAll(/\s+/g, ' ').trim(); }; + // Extract attributes from agent tag + const extractAgentAttribute = (attr) => { + const match = xmlContent.match(new RegExp(`]*\\s${attr}=["']([^"']+)["']`)); + return match ? match[1] : ''; + }; + const extractPrinciples = () => { const match = xmlContent.match(/([\s\S]*?)<\/principles>/); if (!match) return ''; @@ -689,11 +695,15 @@ function extractManifestData(xmlContent, metadata, agentPath, moduleName = 'cust return principles; }; + // Prioritize XML extraction over metadata for agent persona info + const xmlTitle = extractAgentAttribute('title') || extractTag('name'); + const xmlIcon = extractAgentAttribute('icon'); + return { name: metadata.id ? path.basename(metadata.id, '.md') : metadata.name.toLowerCase().replaceAll(/\s+/g, '-'), - displayName: metadata.name || '', - title: metadata.title || '', - icon: metadata.icon || '', + displayName: xmlTitle || metadata.name || '', + title: xmlTitle || metadata.title || '', + icon: xmlIcon || metadata.icon || '', role: extractTag('role'), identity: extractTag('identity'), communicationStyle: extractTag('communication_style'),