mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-31 04:57:23 +08:00
refactor: route agent task settings through runtime
This commit is contained in:
@@ -12,7 +12,9 @@ from app.agent.tools.tags import ToolTag
|
||||
from app.chain.download import DownloadChain
|
||||
from app.chain.media import MediaChain
|
||||
from app.chain.search import SearchChain
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.domain.context import Context
|
||||
from app.domain.metainfo import MetaInfo
|
||||
from app.application.agentdata import SitePort as SiteOper
|
||||
|
||||
@@ -7,7 +7,9 @@ from pydantic import BaseModel, Field, model_validator
|
||||
|
||||
from app.agent.tools.base import MoviePilotTool
|
||||
from app.agent.tools.tags import ToolTag
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.application.agentdata import AgentChatPort as AgentChatOper
|
||||
from app.application.agentdata import AgentTaskPort as AgentTaskOper
|
||||
from app.runtime.scheduling import TimerUtils
|
||||
|
||||
@@ -5,7 +5,9 @@ from pydantic import BaseModel, Field
|
||||
|
||||
from app.agent.tools.base import MoviePilotTool
|
||||
from app.agent.tools.tags import ToolTag
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.application.agentdata import AgentTaskPort as AgentTaskOper
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,9 @@ from pydantic import BaseModel, Field
|
||||
from app.agent.tools.base import MoviePilotTool
|
||||
from app.agent.tools.tags import ToolTag
|
||||
from app.chain.media import MediaChain
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.domain.context import Context
|
||||
from app.domain.meta.metamusic import MetaMusic
|
||||
from app.domain.metainfo import MetaInfo
|
||||
|
||||
@@ -10,7 +10,9 @@ from app.agent.tools.base import MoviePilotTool
|
||||
from app.agent.tools.tags import ToolTag
|
||||
from app.chain.media import MediaChain
|
||||
from app.chain.scraping import ScrapingChain
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.log import logger
|
||||
from app.schemas.workflow import FileItem
|
||||
from app.schemas.types import (
|
||||
|
||||
@@ -9,7 +9,9 @@ from pydantic import BaseModel, Field
|
||||
|
||||
from app.agent.tools.base import MoviePilotTool
|
||||
from app.agent.tools.tags import ToolTag
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.log import logger
|
||||
|
||||
# 搜索超时时间(秒)
|
||||
|
||||
@@ -7,7 +7,9 @@ from pydantic import BaseModel, Field, model_validator
|
||||
|
||||
from app.agent.tools.base import MoviePilotTool
|
||||
from app.agent.tools.tags import ToolTag
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.application.agentdata import AgentTaskPort as AgentTaskOper
|
||||
from app.runtime.scheduling import TimerUtils
|
||||
|
||||
|
||||
@@ -1054,6 +1054,8 @@ Agent 能力适配器、记忆和提示词模块改用 `RuntimeSettingsCompat`
|
||||
配置债务由 93 个文件降至 89 个,技能、工具和安全专项测试通过。
|
||||
运行时状态、线程池、插件目录/管理器和模块管理器随后切换到同一动态运行时端口,保留旧模块覆盖语义;
|
||||
配置债务由 89 个文件降至 84 个,插件、模块生命周期与线程安全专项测试通过。
|
||||
Agent 下载、任务、媒体识别、刮削和 Web 搜索工具也切换到动态运行时端口,保留原工具输入与输出 ABI;
|
||||
配置债务由 84 个文件降至 77 个,Agent 任务、搜索与识别专项测试通过。
|
||||
|
||||
同日修正适配器配置下沉边界:OCR、CookieCloud、DoH、Rust 和资源签名等低层实现不再直接依赖
|
||||
`app.application`,由 `app.runtime.settings` 端口承接组合根注入;未启动装配时仍回退旧 Settings ABI,
|
||||
|
||||
@@ -9,16 +9,9 @@
|
||||
"root": "app"
|
||||
},
|
||||
"settings_imports": {
|
||||
"count": 84,
|
||||
"count": 77,
|
||||
"files": [
|
||||
"app/adapters/system/fsproxy.py",
|
||||
"app/agent/tools/impl/add_download_tasks.py",
|
||||
"app/agent/tools/impl/create_agent_task.py",
|
||||
"app/agent/tools/impl/query_agent_tasks.py",
|
||||
"app/agent/tools/impl/recognize_media.py",
|
||||
"app/agent/tools/impl/scrape_metadata.py",
|
||||
"app/agent/tools/impl/search_web.py",
|
||||
"app/agent/tools/impl/update_agent_task.py",
|
||||
"app/cli.py",
|
||||
"app/db/base.py",
|
||||
"app/db/engine.py",
|
||||
|
||||
+8
-8
@@ -14,7 +14,7 @@
|
||||
"workflow_to_db": []
|
||||
},
|
||||
"edge_count": 6421,
|
||||
"edge_sha256": "466c1f146a2ce7403e60f32c98c7b33466b335dba3bfd2f756e7bef22a135e5e",
|
||||
"edge_sha256": "18448b750688670f90d17bc46bc5425dc481a12266b01d3e126f0da13fe12fb7",
|
||||
"edges": [
|
||||
"app -> app.runtime",
|
||||
"app -> app.runtime.compat",
|
||||
@@ -624,8 +624,8 @@
|
||||
"app.agent.tools.impl.add_download_tasks -> app.foundation",
|
||||
"app.agent.tools.impl.add_download_tasks -> app.foundation.crypto",
|
||||
"app.agent.tools.impl.add_download_tasks -> app.runtime",
|
||||
"app.agent.tools.impl.add_download_tasks -> app.runtime.config",
|
||||
"app.agent.tools.impl.add_download_tasks -> app.runtime.log",
|
||||
"app.agent.tools.impl.add_download_tasks -> app.runtime.settings",
|
||||
"app.agent.tools.impl.add_download_tasks -> app.schemas",
|
||||
"app.agent.tools.impl.add_download_tasks -> app.schemas.file",
|
||||
"app.agent.tools.impl.add_rule_group -> app.agent",
|
||||
@@ -690,8 +690,8 @@
|
||||
"app.agent.tools.impl.create_agent_task -> app.application.agentdata",
|
||||
"app.agent.tools.impl.create_agent_task -> app.application.scheduling",
|
||||
"app.agent.tools.impl.create_agent_task -> app.runtime",
|
||||
"app.agent.tools.impl.create_agent_task -> app.runtime.config",
|
||||
"app.agent.tools.impl.create_agent_task -> app.runtime.scheduling",
|
||||
"app.agent.tools.impl.create_agent_task -> app.runtime.settings",
|
||||
"app.agent.tools.impl.delete_agent_task -> app.agent",
|
||||
"app.agent.tools.impl.delete_agent_task -> app.agent.tools",
|
||||
"app.agent.tools.impl.delete_agent_task -> app.agent.tools.base",
|
||||
@@ -841,7 +841,7 @@
|
||||
"app.agent.tools.impl.query_agent_tasks -> app.application.agentdata",
|
||||
"app.agent.tools.impl.query_agent_tasks -> app.application.scheduling",
|
||||
"app.agent.tools.impl.query_agent_tasks -> app.runtime",
|
||||
"app.agent.tools.impl.query_agent_tasks -> app.runtime.config",
|
||||
"app.agent.tools.impl.query_agent_tasks -> app.runtime.settings",
|
||||
"app.agent.tools.impl.query_builtin_filter_rules -> app.agent",
|
||||
"app.agent.tools.impl.query_builtin_filter_rules -> app.agent.tools",
|
||||
"app.agent.tools.impl.query_builtin_filter_rules -> app.agent.tools.base",
|
||||
@@ -1150,8 +1150,8 @@
|
||||
"app.agent.tools.impl.recognize_media -> app.domain.meta.metamusic",
|
||||
"app.agent.tools.impl.recognize_media -> app.domain.metainfo",
|
||||
"app.agent.tools.impl.recognize_media -> app.runtime",
|
||||
"app.agent.tools.impl.recognize_media -> app.runtime.config",
|
||||
"app.agent.tools.impl.recognize_media -> app.runtime.log",
|
||||
"app.agent.tools.impl.recognize_media -> app.runtime.settings",
|
||||
"app.agent.tools.impl.recognize_media -> app.schemas",
|
||||
"app.agent.tools.impl.recognize_media -> app.schemas.types",
|
||||
"app.agent.tools.impl.reload_plugin -> app.agent",
|
||||
@@ -1212,8 +1212,8 @@
|
||||
"app.agent.tools.impl.scrape_metadata -> app.domain",
|
||||
"app.agent.tools.impl.scrape_metadata -> app.domain.media",
|
||||
"app.agent.tools.impl.scrape_metadata -> app.runtime",
|
||||
"app.agent.tools.impl.scrape_metadata -> app.runtime.config",
|
||||
"app.agent.tools.impl.scrape_metadata -> app.runtime.log",
|
||||
"app.agent.tools.impl.scrape_metadata -> app.runtime.settings",
|
||||
"app.agent.tools.impl.scrape_metadata -> app.schemas",
|
||||
"app.agent.tools.impl.scrape_metadata -> app.schemas.media",
|
||||
"app.agent.tools.impl.scrape_metadata -> app.schemas.types",
|
||||
@@ -1287,8 +1287,8 @@
|
||||
"app.agent.tools.impl.search_web -> app.agent.tools.base",
|
||||
"app.agent.tools.impl.search_web -> app.agent.tools.tags",
|
||||
"app.agent.tools.impl.search_web -> app.runtime",
|
||||
"app.agent.tools.impl.search_web -> app.runtime.config",
|
||||
"app.agent.tools.impl.search_web -> app.runtime.log",
|
||||
"app.agent.tools.impl.search_web -> app.runtime.settings",
|
||||
"app.agent.tools.impl.send_local_file -> app.agent",
|
||||
"app.agent.tools.impl.send_local_file -> app.agent.tools",
|
||||
"app.agent.tools.impl.send_local_file -> app.agent.tools.base",
|
||||
@@ -1365,8 +1365,8 @@
|
||||
"app.agent.tools.impl.update_agent_task -> app.application.agentdata",
|
||||
"app.agent.tools.impl.update_agent_task -> app.application.scheduling",
|
||||
"app.agent.tools.impl.update_agent_task -> app.runtime",
|
||||
"app.agent.tools.impl.update_agent_task -> app.runtime.config",
|
||||
"app.agent.tools.impl.update_agent_task -> app.runtime.scheduling",
|
||||
"app.agent.tools.impl.update_agent_task -> app.runtime.settings",
|
||||
"app.agent.tools.impl.update_custom_filter_rule -> app.agent",
|
||||
"app.agent.tools.impl.update_custom_filter_rule -> app.agent.tools",
|
||||
"app.agent.tools.impl.update_custom_filter_rule -> app.agent.tools.base",
|
||||
|
||||
@@ -126,8 +126,8 @@ def test_transaction_debt_baseline_is_a_model_and_oper_ratchet() -> None:
|
||||
baseline = json.loads(baseline_path.read_text(encoding="utf-8"))
|
||||
|
||||
assert baseline["schema_version"] == 1
|
||||
assert baseline["model_decorators"]["count"] == 117
|
||||
assert sum(baseline["model_decorators"]["by_kind"].values()) == 117
|
||||
assert baseline["model_decorators"]["count"] == 106
|
||||
assert sum(baseline["model_decorators"]["by_kind"].values()) == 106
|
||||
assert baseline["model_decorators"]["by_kind"]["db_update"] == 0
|
||||
assert baseline["model_decorators"]["by_kind"]["async_db_update"] == 0
|
||||
assert baseline["model_transaction_calls"] == {"count": 0, "calls": []}
|
||||
|
||||
Reference in New Issue
Block a user