fix(配置): 模型相对路径按运行目录解析

模型相对路径以进程当前工作目录为基准,绝对路径继续直接使用。示例改为 models/guard_model,并补充路径迁移与容器挂载说明。

新增工作目录与配置目录分离、绝对路径和缺失目录校验测试。配置与 LLM 测试 20 项通过;全量测试 75 项通过,2 项现有插件示例测试因缺少初始化配置失败。
This commit is contained in:
starrrLight committed 2026-10-13 16:42:54 +08:00
1 parent fd71fc4063
commit 5d71803b02
4 files changed
+49 -3

No files matched your search

+1 -1
View File
@@ -181,7 +181,7 @@ def load_settings(path: str | Path) -> Settings:
plugins.append(plugin.model_copy(update={"file": file}))
models = []
for model in settings.llm:
file = (path.parent / model.file).resolve()
file = model.file.resolve()
if not file.exists():
raise ValueError(f"llm model path not found: {model.id}")
models.append(model.model_copy(update={"file": file}))