fix: improve maintenance and synchronize live conversations

This commit is contained in:
WangShen007 committed 2026-10-29 09:46:21 +08:00
1 parent bb541bd212
commit ef86a5d3af
297 files changed
+2983 -1274

No files matched your search

+2 -2
View File
@@ -119,13 +119,13 @@ def _build_agent(choice_limits) -> ChatAgent:
storage = Mock()
storage.get_session_state.return_value = {"status": "active"}
with patch('app.agents.chat_agent.get_db') as mock_get_db, \
with patch('app.agents.chat_agent.SessionLocal') as mock_session_local, \
patch('app.agents.chat_agent.JiraRepository') as mock_jira_repo, \
patch('app.tools.knowledge_search_byagent.KnowledgeSearchByAgent', return_value=Mock()), \
patch('app.agents.chat_agent.EncryptedPostgresAgentStorage', return_value=storage), \
patch('app.agents.chat_agent.settings.DATABASE_URL', "mock://test"), \
patch.dict('os.environ', {}, clear=True):
mock_get_db.return_value = iter([MagicMock(spec=Session)])
mock_session_local.return_value.__enter__.return_value = MagicMock(spec=Session)
mock_jira_repo.return_value.get_agent_with_jira_config.return_value = agent_data
return ChatAgent(api_key="test-key", model_name="gpt-4", model_type="openai",
org_id=str(uuid4()), agent_id=str(uuid4()),