mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-09 09:26:55 +08:00
fix(agent): auto-load gateway skill before API calls
This commit is contained in:
@@ -124,8 +124,13 @@ def _ensure_project_import() -> None:
|
||||
def _load_configs() -> list[Any]:
|
||||
"""读取并校验本机下载器配置。"""
|
||||
_ensure_project_import()
|
||||
from app.db.oper.systemconfig import SystemConfigOper
|
||||
from app.runtime.extensions.service import ServiceConfigHelper
|
||||
from app.runtime.extensions.service import configure_service_config_reader
|
||||
|
||||
system_config = SystemConfigOper()
|
||||
system_config.load_snapshot()
|
||||
configure_service_config_reader(system_config.get)
|
||||
return ServiceConfigHelper.get_downloader_configs()
|
||||
|
||||
|
||||
|
||||
@@ -118,8 +118,13 @@ def _ensure_project_import() -> None:
|
||||
def _load_configs() -> list[Any]:
|
||||
"""读取并校验本机媒体服务器配置。"""
|
||||
_ensure_project_import()
|
||||
from app.db.oper.systemconfig import SystemConfigOper
|
||||
from app.runtime.extensions.service import ServiceConfigHelper
|
||||
from app.runtime.extensions.service import configure_service_config_reader
|
||||
|
||||
system_config = SystemConfigOper()
|
||||
system_config.load_snapshot()
|
||||
configure_service_config_reader(system_config.get)
|
||||
return ServiceConfigHelper.get_mediaserver_configs()
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,10 @@ Use `moviepilot_api` for normal MoviePilot business operations. The tool accepts
|
||||
only `operation_id`, `path_params`, `query`, and `body`. The host chooses the
|
||||
fixed HTTP method and path, creates the current user's authentication token,
|
||||
applies authorization and confirmation policy, and returns the API response.
|
||||
When the gateway is called directly, the host automatically loads this Skill's
|
||||
operation scope before enforcing the allowlist; explicitly loading the Skill is
|
||||
still preferred so the model receives the full parameter and failure-handling
|
||||
contract before it calls the gateway.
|
||||
|
||||
Never provide a URL, method, authentication header, API key, or access token.
|
||||
Never fall back to a retired tool name or `moviepilot tool` MCP command. If an
|
||||
|
||||
Reference in New Issue
Block a user