feat: Use agent name as dynamic Langfuse trace name

Fall back to model name, then 'AgentRun' when agent name is unavailable.
This commit is contained in:
Dustin Healy 2026-03-07 00:08:44 -08:00
parent d5d16da0b1
commit 3919d005e5
3 changed files with 4 additions and 4 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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,