modify: 修复未找到如何 RPC 方法的问题

This commit is contained in:
2026-08-03 17:04:52 +08:00
parent 49229977e7
commit c4a539f8d4
+7 -1
View File
@@ -244,9 +244,15 @@ def _discover_plugins() -> list[dict]:
if not workers_section: if not workers_section:
continue continue
# 合并运行时 config: 整个 TOML 顶层 + [workers.config] 展平 # 合并运行时 config:
# 1. plugin_conf 顶层 (worker, worker.registration 等 gen_models 用)
# 2. [workers] 节的注册字段展平 (type, module, factory, cleanup, count)
# — 其中 type 被 chongming_worker.runtime.create_workers 用于匹配 RPC 方法
# 3. [workers.config] 展平到顶层 (api_key, data_dir, heartbeat 等)
workers_flat = {k: v for k, v in workers_section.items() if k != "config"}
runtime_config = { runtime_config = {
**plugin_conf, **plugin_conf,
**workers_flat,
**workers_section.get("config", {}), **workers_section.get("config", {}),
} }