fix: agent_tags for provider traces (#8989)

* add include tags

* include agent_tags and pass them into the adapter
This commit is contained in:
Kian Jones
2026-01-20 18:59:56 -08:00
committed by Caren Thomas
parent 2fc592e0b6
commit 7133083b81
3 changed files with 22 additions and 6 deletions

View File

@@ -168,7 +168,11 @@ class LettaAgentV3(LettaAgentV2):
input_messages_to_persist=input_messages_to_persist,
# TODO need to support non-streaming adapter too
llm_adapter=SimpleLLMRequestAdapter(
llm_client=self.llm_client, llm_config=self.agent_state.llm_config, agent_id=self.agent_state.id, run_id=run_id
llm_client=self.llm_client,
llm_config=self.agent_state.llm_config,
agent_id=self.agent_state.id,
agent_tags=self.agent_state.tags,
run_id=run_id,
),
run_id=run_id,
# use_assistant_message=use_assistant_message,
@@ -310,6 +314,7 @@ class LettaAgentV3(LettaAgentV2):
llm_client=self.llm_client,
llm_config=self.agent_state.llm_config,
agent_id=self.agent_state.id,
agent_tags=self.agent_state.tags,
run_id=run_id,
)
else:
@@ -317,6 +322,7 @@ class LettaAgentV3(LettaAgentV2):
llm_client=self.llm_client,
llm_config=self.agent_state.llm_config,
agent_id=self.agent_state.id,
agent_tags=self.agent_state.tags,
run_id=run_id,
)

View File

@@ -628,7 +628,9 @@ async def run_tool_for_agent(
# Get agent with all relationships
agent = await server.agent_manager.get_agent_by_id_async(
agent_id, actor, include_relationships=["memory", "multi_agent_group", "sources", "tool_exec_environment_variables", "tools"]
agent_id,
actor,
include_relationships=["memory", "multi_agent_group", "sources", "tool_exec_environment_variables", "tools", "tags"],
)
# Find the tool by name among attached tools
@@ -1520,7 +1522,9 @@ async def send_message(
MetricRegistry().user_message_counter.add(1, get_ctx_attributes())
# TODO: This is redundant, remove soon
agent = await server.agent_manager.get_agent_by_id_async(
agent_id, actor, include_relationships=["memory", "multi_agent_group", "sources", "tool_exec_environment_variables", "tools"]
agent_id,
actor,
include_relationships=["memory", "multi_agent_group", "sources", "tool_exec_environment_variables", "tools", "tags"],
)
# Handle model override if specified in the request
@@ -1799,7 +1803,9 @@ async def _process_message_background(
try:
agent = await server.agent_manager.get_agent_by_id_async(
agent_id, actor, include_relationships=["memory", "multi_agent_group", "sources", "tool_exec_environment_variables", "tools"]
agent_id,
actor,
include_relationships=["memory", "multi_agent_group", "sources", "tool_exec_environment_variables", "tools", "tags"],
)
# Handle model override if specified
@@ -1966,7 +1972,9 @@ async def send_message_async(
if use_lettuce:
agent_state = await server.agent_manager.get_agent_by_id_async(
agent_id, actor, include_relationships=["memory", "multi_agent_group", "sources", "tool_exec_environment_variables", "tools"]
agent_id,
actor,
include_relationships=["memory", "multi_agent_group", "sources", "tool_exec_environment_variables", "tools", "tags"],
)
# Allow V1 agents only if the message async flag is enabled
is_v1_message_async_enabled = (

View File

@@ -95,7 +95,9 @@ class StreamingService:
# load agent and check eligibility
agent = await self.server.agent_manager.get_agent_by_id_async(
agent_id, actor, include_relationships=["memory", "multi_agent_group", "sources", "tool_exec_environment_variables", "tools"]
agent_id,
actor,
include_relationships=["memory", "multi_agent_group", "sources", "tool_exec_environment_variables", "tools", "tags"],
)
# Handle model override if specified in the request