chore: sync database worker branch with upstream v3

This commit is contained in:
InfinityPacer
2026-08-23 04:48:50 +08:00
111 changed files with 605 additions and 391 deletions
+3 -1
View File
@@ -12,7 +12,9 @@ from app.agent.runtime_loader import (
from app.agent.llm.gateway import register_llm_provider_runtime
from app.application.agent import register_agent_service_providers
from app.application.messaging.skill import register_skill_catalog_provider
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.runtime.events import Event, eventmanager
from app.runtime.log import logger
from app.schemas.types import EventType
+3 -1
View File
@@ -20,7 +20,9 @@ from app.db.engine import get_engine
from app.db.health import probe_database
from app.db.maintenance import DatabaseCleanupRepository
from app.db.session import SessionFactory
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
def build_database_governance() -> DatabaseGovernance:
+3 -1
View File
@@ -10,7 +10,9 @@ from alembic.util import CommandError
from sqlalchemy import inspect
from sqlalchemy.engine import Engine
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.db.base import Base
from app.db.engine import get_engine
from app.db.models import load_all_models
+3 -1
View File
@@ -6,7 +6,9 @@ from app.domain.meta.runtime import configure_recognition_runtime
from app.domain.meta.words import configure_custom_words_provider
from app.domain.metainfo import clear_rust_parse_options_cache
from app.adapters.system import rust as rust_accelerator
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.application.recognition import RecognitionRuleService
+4 -1
View File
@@ -26,7 +26,10 @@ except Exception:
from app.chain.system import SystemChain
from app.application.plugin.runtime import get_plugin_manager
from app.runtime.config import global_vars, settings
from app.runtime.config import global_vars
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.runtime.health import get_application_health
from app.runtime.topology import validate_process_topology
from app.adapters.external.server import MoviePilotServerHelper
+5 -2
View File
@@ -17,7 +17,10 @@ except ImportError as e:
from app.adapters.system.host import SystemUtils
from app.runtime.log import logger
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
from app.runtime.config import settings as legacy_settings
settings = RuntimeSettingsCompat()
from app.runtime.cache import AsyncFileCache, FileCache
from app.runtime.extensions.module_manager import ModuleManager
from app.runtime.extensions.module.dispatcher import ModuleInvocationDispatcher
@@ -669,7 +672,7 @@ async def init_modules() -> HostRuntime:
)
configure_runtime_configuration(host_runtime.configuration)
configure_runtime_settings(host_runtime.settings)
configure_runtime_setting_provider(lambda key: getattr(settings, key))
configure_runtime_setting_provider(lambda key: getattr(legacy_settings, key))
configure_token_runtime_config(lambda: build_token_runtime_config(settings))
# 旧 app.api.data 导入只保留 ABI 转发,正式 API 依赖全部读取 HostRuntime。
configure_api_data_runtime(api_data)
+3 -1
View File
@@ -7,7 +7,9 @@ from app.runtime.compat.diagnostics import (
from app.runtime.compat.resource_imports import scan_plugin_resource_imports
from app.application.plugin.routes import register_plugin_api
from app.runtime.config import global_vars
from app.runtime.config import settings
from app.runtime.settings import RuntimeSettingsCompat
settings = RuntimeSettingsCompat()
from app.runtime.extensions.plugin_manager import (
PluginManager,
configure_plugin_catalog_factory,