From 3919d005e5118ff33c6f40521faf4b0abc0d8aa4 Mon Sep 17 00:00:00 2001 From: Dustin Healy <54083382+dustinhealy@users.noreply.github.com> Date: Sat, 7 Mar 2026 00:08:44 -0800 Subject: [PATCH] feat: Use agent name as dynamic Langfuse trace name Fall back to model name, then 'AgentRun' when agent name is unavailable. --- api/server/controllers/agents/client.js | 2 +- api/server/controllers/agents/openai.js | 2 +- api/server/controllers/agents/responses.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/server/controllers/agents/client.js b/api/server/controllers/agents/client.js index 17aecb3f09..d17d3333ab 100644 --- a/api/server/controllers/agents/client.js +++ b/api/server/controllers/agents/client.js @@ -725,7 +725,7 @@ class AgentClient extends BaseClient { const agentsEConfig = appConfig.endpoints?.[EModelEndpoint.agents]; config = { - runName: 'AgentRun', + runName: this.options.agent.name || this.model || 'AgentRun', configurable: { thread_id: this.conversationId, last_agent_index: this.agentConfigs?.size ?? 0, diff --git a/api/server/controllers/agents/openai.js b/api/server/controllers/agents/openai.js index c10d07d672..14d77b7295 100644 --- a/api/server/controllers/agents/openai.js +++ b/api/server/controllers/agents/openai.js @@ -466,7 +466,7 @@ const OpenAIChatCompletionController = async (req, res) => { // Process the stream const config = { - runName: 'AgentRun', + runName: agent.name || agent.model_parameters?.model || 'AgentRun', configurable: { thread_id: conversationId, user_id: userId, diff --git a/api/server/controllers/agents/responses.js b/api/server/controllers/agents/responses.js index 20ee178767..b64715efb2 100644 --- a/api/server/controllers/agents/responses.js +++ b/api/server/controllers/agents/responses.js @@ -482,7 +482,7 @@ const createResponse = async (req, res) => { // Process the stream const config = { - runName: 'AgentRun', + runName: agent.name || agent.model_parameters?.model || 'AgentRun', configurable: { thread_id: conversationId, user_id: userId, @@ -638,7 +638,7 @@ const createResponse = async (req, res) => { } const config = { - runName: 'AgentRun', + runName: agent.name || agent.model_parameters?.model || 'AgentRun', configurable: { thread_id: conversationId, user_id: userId,