remove:移除全局config快照到snapshot防止撑爆环境变量

This commit is contained in:
SengokuCola
2026-05-06 00:10:33 +08:00
parent 55deb36ce4
commit 371eb5c0f7
2 changed files with 5 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ import os
import sys
from src.common.logger import get_logger
from src.config.config import config_manager, global_config
from src.config.config import global_config
from src.llm_models.model_client.base_client import ClientProviderRegistration, client_registry
from src.llm_models.model_client.plugin_client import PluginLLMClient
from src.platform_io import DriverKind, InboundMessageEnvelope, RouteBinding, RouteKey, get_platform_io_manager
@@ -18,7 +18,6 @@ from src.platform_io.route_key_factory import RouteKeyFactory
from src.plugin_runtime import (
ENV_BLOCKED_PLUGIN_REASONS,
ENV_EXTERNAL_PLUGIN_IDS,
ENV_GLOBAL_CONFIG_SNAPSHOT,
ENV_HOST_VERSION,
ENV_IPC_ADDRESS,
ENV_PLUGIN_DIRS,
@@ -1409,12 +1408,9 @@ class PluginRunnerSupervisor:
Returns:
Dict[str, str]: 传递给 Runner 进程的环境变量映射。
"""
global_config_snapshot = config_manager.get_global_config().model_dump(mode="json")
global_config_snapshot["model"] = config_manager.get_model_config().model_dump(mode="json")
return {
ENV_BLOCKED_PLUGIN_REASONS: json.dumps(self._blocked_plugin_reasons, ensure_ascii=False),
ENV_EXTERNAL_PLUGIN_IDS: json.dumps(self._external_available_plugins, ensure_ascii=False),
ENV_GLOBAL_CONFIG_SNAPSHOT: json.dumps(global_config_snapshot, ensure_ascii=False),
ENV_HOST_VERSION: PROTOCOL_VERSION,
ENV_IPC_ADDRESS: self._transport.get_address(),
ENV_PLUGIN_DIRS: os.pathsep.join(str(path) for path in self._plugin_dirs),

8
uv.lock generated
View File

@@ -1511,7 +1511,7 @@ requires-dist = [
{ name = "httpx", extras = ["socks"] },
{ name = "jieba", specifier = ">=0.42.1" },
{ name = "json-repair", specifier = ">=0.47.6" },
{ name = "maibot-dashboard", specifier = ">=1.0.5.dev2026050573" },
{ name = "maibot-dashboard", specifier = ">=1.0.5" },
{ name = "maibot-plugin-sdk", specifier = ">=2.4.0" },
{ name = "maim-message", specifier = ">=0.6.2" },
{ name = "matplotlib", specifier = ">=3.10.5" },
@@ -1549,11 +1549,11 @@ dev = [
[[package]]
name = "maibot-dashboard"
version = "1.0.5.dev2026050574"
version = "1.0.5"
source = { registry = "https://pypi.tuna.tsinghua.edu.cn/simple" }
sdist = { url = "https://pypi.tuna.tsinghua.edu.cn/packages/78/b9/4cd7c3c78c937a8dd5b30f42889493819df1c56066d66855ea293f5e7171/maibot_dashboard-1.0.5.dev2026050574.tar.gz", hash = "sha256:1b032721ca8f52bc951406932888367e4d73ee06ad8aaaf5879e95b34495decf", size = 2477288, upload-time = "2026-05-05T09:59:02.15Z" }
sdist = { url = "https://pypi.tuna.tsinghua.edu.cn/packages/b8/a7/eb1032664ea98b58a861412aca19b31066dc3368f1264a2a53970bd9385c/maibot_dashboard-1.0.5.tar.gz", hash = "sha256:3480723e42120defbaf8ebb952c45bc3e0cd9274a04c5acda0331e55e15ebdc1", size = 2477306, upload-time = "2026-05-05T10:40:34.327Z" }
wheels = [
{ url = "https://pypi.tuna.tsinghua.edu.cn/packages/ff/7c/4e522a3632e60e4bee7a9a71dd46e2c60b05b1442db66c2e4a04657e780a/maibot_dashboard-1.0.5.dev2026050574-py3-none-any.whl", hash = "sha256:6a1af06ef226328a07b792cff8732a683f511602e428ea8f36b547b43590283a", size = 2541882, upload-time = "2026-05-05T09:59:00.595Z" },
{ url = "https://pypi.tuna.tsinghua.edu.cn/packages/3a/a0/ad4f7c1d381875ca8d1aeedf5ff6e94692f64cf558479f9e845e47bca830/maibot_dashboard-1.0.5-py3-none-any.whl", hash = "sha256:67bfbb82a1ddd666d20cc958864db38df2e5493f77df0cb049ae83987b1dd65d", size = 2542631, upload-time = "2026-05-05T10:40:32.5Z" },
]
[[package]]