mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-06 16:07:01 +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:
+14
-5
@@ -51,7 +51,8 @@ from app.runtime.scheduling import TimerUtils
|
||||
|
||||
lock = threading.Lock()
|
||||
SCHEDULER_PROGRESS_PREFIX = "scheduler"
|
||||
AGENT_TASK_JOB_PREFIX = "agent-task"
|
||||
# Agent 自主定时任务前缀下沉到 application 门面,此处保留兼容导出。
|
||||
from app.application.scheduling import AGENT_TASK_JOB_PREFIX # noqa: E402
|
||||
|
||||
|
||||
class SchedulerChain(ChainBase):
|
||||
@@ -1220,10 +1221,14 @@ class Scheduler(ConfigReloadMixin, metaclass=SingletonClass):
|
||||
:param trigger_source: 触发入口,scheduled-自动调度,manual-显式立即执行
|
||||
:return: 执行是否成功及结果摘要
|
||||
"""
|
||||
from app.agent.orchestrator import agent_manager
|
||||
from app.agent.runtime_loader import get_running_agent_manager
|
||||
|
||||
try:
|
||||
return await agent_manager.execute_scheduled_task(
|
||||
manager = get_running_agent_manager()
|
||||
if manager is None:
|
||||
logger.warning("智能助手服务未运行,跳过 Agent 定时任务")
|
||||
return False, "智能助手服务未运行"
|
||||
return await manager.execute_scheduled_task(
|
||||
task_id,
|
||||
trigger_source=trigger_source,
|
||||
)
|
||||
@@ -1536,9 +1541,13 @@ class Scheduler(ConfigReloadMixin, metaclass=SingletonClass):
|
||||
"""
|
||||
智能体心跳唤醒:检查并执行待处理的定时任务
|
||||
"""
|
||||
from app.agent.orchestrator import agent_manager
|
||||
from app.agent.runtime_loader import get_running_agent_manager
|
||||
|
||||
await agent_manager.heartbeat_check_jobs()
|
||||
manager = get_running_agent_manager()
|
||||
if manager is None:
|
||||
logger.debug("智能助手服务未运行,跳过心跳任务")
|
||||
return
|
||||
await manager.heartbeat_check_jobs()
|
||||
|
||||
def user_auth(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user