fix:A_Memorix 缺失总结模型配置导致导入异常
修复默认值与迁移补写逻辑,并补充回归测试覆盖缺失与旧格式场景。
This commit is contained in:
@@ -136,7 +136,9 @@ class SummaryImporter:
|
||||
if not available_tasks:
|
||||
return None
|
||||
|
||||
raw_cfg = self.plugin_config.get("summarization", {}).get("model_name", "auto")
|
||||
# vNext 要求该字段为 List[str];当配置缺失时回退到 ["auto"],
|
||||
# 避免默认值本身触发类型校验异常。
|
||||
raw_cfg = self.plugin_config.get("summarization", {}).get("model_name", ["auto"])
|
||||
selectors = self._normalize_summary_model_selectors(raw_cfg)
|
||||
default_task_name, default_task_cfg = self._pick_default_summary_task(available_tasks)
|
||||
|
||||
|
||||
@@ -472,7 +472,11 @@ def _migrate_config(config_doc: Dict[str, Any]) -> Dict[str, Any]:
|
||||
|
||||
summary = _ensure_table(config_doc, "summarization")
|
||||
summary_model = summary.get("model_name", ["auto"])
|
||||
if isinstance(summary_model, str):
|
||||
if "model_name" not in summary:
|
||||
normalized = ["auto"]
|
||||
summary["model_name"] = normalized
|
||||
changes["summarization.model_name"] = {"old": "<missing>", "new": normalized}
|
||||
elif isinstance(summary_model, str):
|
||||
normalized = [summary_model.strip() or "auto"]
|
||||
summary["model_name"] = normalized
|
||||
changes["summarization.model_name"] = {"old": summary_model, "new": normalized}
|
||||
|
||||
Reference in New Issue
Block a user