mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
Merge remote-tracking branch 'origin/v3' into v3
# Conflicts: # app/api/endpoints/agent.py # app/api/endpoints/anthropic.py # app/api/endpoints/openai.py # app/chain/__init__.py # app/chain/message.py # app/chain/site.py # app/chain/subscribe.py # app/chain/transfer.py # app/modules/discord/__init__.py # app/modules/qqbot/__init__.py # app/modules/slack/__init__.py # app/modules/telegram/__init__.py # app/modules/wechat/__init__.py # app/runtime/extensions/module_manager.py # app/runtime/extensions/service_registry.py # tests/test_agent_interaction.py # tests/test_slash_command_interactions.py # tests/test_web_agent_stream.py
This commit is contained in:
@@ -132,9 +132,12 @@ class TestTransferFailedRetryButtons(unittest.TestCase):
|
||||
|
||||
with patch.object(settings, "AI_AGENT_ENABLE", True):
|
||||
with patch(
|
||||
"app.chain.transfer.TransferHistoryOper"
|
||||
"app.chain._transfer.TransferHistoryOper"
|
||||
) as history_oper_cls, patch(
|
||||
"app.chain.transfer.asyncio.run_coroutine_threadsafe",
|
||||
"app.chain._transfer.build_manual_redo_prompt",
|
||||
return_value="retry transfer prompt",
|
||||
), patch(
|
||||
"app.chain._transfer.asyncio.run_coroutine_threadsafe",
|
||||
side_effect=_close_pending_coro,
|
||||
) as run_task:
|
||||
history_oper_cls.return_value.get.return_value = history
|
||||
@@ -200,14 +203,20 @@ class TestTransferFailedRetryButtons(unittest.TestCase):
|
||||
async def fake_async_post_message(*args, **kwargs):
|
||||
return None
|
||||
|
||||
from app.agent.prompt.transfer_redo import build_manual_redo_prompt
|
||||
|
||||
manager = SimpleNamespace(run_background_prompt=fake_run_background_prompt)
|
||||
with patch.object(settings, "AI_AGENT_ENABLE", True):
|
||||
with patch(
|
||||
"app.chain.transfer.TransferHistoryOper"
|
||||
"app.chain._transfer.TransferHistoryOper"
|
||||
) as history_oper_cls, patch(
|
||||
"app.chain.transfer.agent_manager.run_background_prompt",
|
||||
side_effect=fake_run_background_prompt,
|
||||
"app.chain._transfer.build_manual_redo_prompt",
|
||||
side_effect=build_manual_redo_prompt,
|
||||
), patch(
|
||||
"app.chain.transfer.asyncio.run_coroutine_threadsafe",
|
||||
"app.chain._transfer.get_running_agent_manager",
|
||||
return_value=manager,
|
||||
), patch(
|
||||
"app.chain._transfer.asyncio.run_coroutine_threadsafe",
|
||||
side_effect=_run_pending_coro,
|
||||
):
|
||||
history_oper_cls.return_value.get.return_value = history
|
||||
|
||||
Reference in New Issue
Block a user