fix: app unawareness of custom secrets in v1 conversations (#11914)

This commit is contained in:
Hiep Le 2025-12-11 14:19:22 +07:00 committed by GitHub
parent f7c3a36745
commit 09e50b876d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View File

@ -650,6 +650,7 @@ class LiveStatusAppConversationService(AppConversationServiceBase):
system_message_suffix: str | None,
mcp_config: dict,
condenser_max_size: int | None,
secrets: dict | None = None,
) -> Agent:
"""Create an agent with appropriate tools and context based on agent type.
@ -659,6 +660,7 @@ class LiveStatusAppConversationService(AppConversationServiceBase):
system_message_suffix: Optional suffix for system messages
mcp_config: MCP configuration dictionary
condenser_max_size: condenser_max_size setting
secrets: Optional dictionary of secrets for authentication
Returns:
Configured Agent instance with context
@ -687,7 +689,9 @@ class LiveStatusAppConversationService(AppConversationServiceBase):
)
# Add agent context
agent_context = AgentContext(system_message_suffix=system_message_suffix)
agent_context = AgentContext(
system_message_suffix=system_message_suffix, secrets=secrets
)
agent = agent.model_copy(update={'agent_context': agent_context})
return agent
@ -784,7 +788,12 @@ class LiveStatusAppConversationService(AppConversationServiceBase):
# Create agent with context
agent = self._create_agent_with_context(
llm, agent_type, system_message_suffix, mcp_config, user.condenser_max_size
llm,
agent_type,
system_message_suffix,
mcp_config,
user.condenser_max_size,
secrets=secrets,
)
# Finalize and return the conversation request

View File

@ -821,5 +821,6 @@ class TestLiveStatusAppConversationService:
'Test suffix',
mock_mcp_config,
self.mock_user.condenser_max_size,
secrets=mock_secrets,
)
self.service._finalize_conversation_request.assert_called_once()