diff --git a/crates/openfang-api/src/routes.rs b/crates/openfang-api/src/routes.rs index 35e8aea8e..5f9ba0899 100644 --- a/crates/openfang-api/src/routes.rs +++ b/crates/openfang-api/src/routes.rs @@ -1412,11 +1412,15 @@ pub async fn get_agent( "network": entry.manifest.capabilities.network, }, "description": entry.manifest.description, + "system_prompt": entry.manifest.model.system_prompt, "tags": entry.manifest.tags, "identity": { "emoji": entry.identity.emoji, "avatar_url": entry.identity.avatar_url, "color": entry.identity.color, + "archetype": entry.identity.archetype, + "vibe": entry.identity.vibe, + "greeting_style": entry.identity.greeting_style, }, "skills": entry.manifest.skills, "skills_mode": if entry.manifest.skills.is_empty() { "all" } else { "allowlist" }, diff --git a/crates/openfang-api/static/js/pages/agents.js b/crates/openfang-api/static/js/pages/agents.js index b46b24bfd..6acccf9ba 100644 --- a/crates/openfang-api/static/js/pages/agents.js +++ b/crates/openfang-api/static/js/pages/agents.js @@ -316,29 +316,38 @@ function agentsPage() { OpenFangAPI.wsDisconnect(); }, + buildConfigForm(agent) { + var identity = (agent && agent.identity) || {}; + return { + name: (agent && agent.name) || '', + system_prompt: (agent && agent.system_prompt) || '', + emoji: identity.emoji || '', + color: identity.color || '#FF5C00', + archetype: identity.archetype || '', + vibe: identity.vibe || '' + }; + }, + async showDetail(agent) { - this.detailAgent = agent; - this.detailAgent._fallbacks = []; this.detailTab = 'info'; this.agentFiles = []; this.editingFile = null; this.fileContent = ''; this.editingFallback = false; this.newFallbackValue = ''; - this.configForm = { - name: agent.name || '', - system_prompt: agent.system_prompt || '', - emoji: (agent.identity && agent.identity.emoji) || '', - color: (agent.identity && agent.identity.color) || '#FF5C00', - archetype: (agent.identity && agent.identity.archetype) || '', - vibe: (agent.identity && agent.identity.vibe) || '' - }; - this.showDetailModal = true; - // Fetch full agent detail to get fallback_models + // Load the full detail payload before opening the modal so editable + // fields such as system_prompt and identity metadata are hydrated. + var detail = agent; try { var full = await OpenFangAPI.get('/api/agents/' + agent.id); - this.detailAgent._fallbacks = full.fallback_models || []; - } catch(e) { /* ignore */ } + detail = Object.assign({}, agent, full, { + identity: Object.assign({}, (agent && agent.identity) || {}, (full && full.identity) || {}) + }); + } catch(e) { /* fall back to list payload */ } + this.detailAgent = detail; + this.detailAgent._fallbacks = detail.fallback_models || []; + this.configForm = this.buildConfigForm(detail); + this.showDetailModal = true; }, killAgent(agent) { diff --git a/crates/openfang-runtime/src/mcp.rs b/crates/openfang-runtime/src/mcp.rs index 81b4d8274..f016f3602 100644 --- a/crates/openfang-runtime/src/mcp.rs +++ b/crates/openfang-runtime/src/mcp.rs @@ -306,10 +306,7 @@ impl McpConnection { } } - // rmcp 1.3+ marks StreamableHttpClientTransportConfig as #[non_exhaustive]. - // Use the official builder API (credit: @jefflower, PR #986). - let config = StreamableHttpClientTransportConfig::with_uri(url) - .custom_headers(custom_headers); + let config = StreamableHttpClientTransportConfig::with_uri(url).custom_headers(custom_headers); let transport = StreamableHttpClientTransport::from_config(config);