fix: sync nested detail enhancement config
这个提交存在于:
父节点
c3d7151f86
当前提交
6f1a80cafd
共有 3 个文件被更改,包括 7 次插入 和 1 次删除
|
|
@ -174,7 +174,7 @@
|
|||
- Phase: D1 implementation and VM deployment tooling.
|
||||
- Type: feature behavior / deployment / testing.
|
||||
- Symptom: schema, runtime fallback, and VM persisted config could independently retain `enable_detail_enhancement=False`; the Bash deploy script depended on an SSH alias and `pytest`.
|
||||
- Root cause: new-install defaults and existing persistent overrides are separate paths; the script assumed a Unix developer environment.
|
||||
- Root cause: new-install defaults, the flat persisted value, and the nested `schedule_detail_config` persisted value are separate paths; startup migration can copy the nested value back over the flat one; the script also assumed a Unix developer environment.
|
||||
- Fix or workaround: set all three defaults to `true`; after stopping AstrBot, deploy writes the VM JSON config before startup; Bash accepts `VM`, `SSH_KEY`, `SSH_PORT`, `PYTHON_BIN`, `SKIP_LOCAL_TESTS`, and `DETAIL_ENHANCEMENT_ENABLED`; add `ops/deploy-plugin.ps1`.
|
||||
- Prevention rule: configuration switches must be checked at schema, runtime fallback, and production persistence layers; cross-machine deploy commands must make SSH and test-runtime dependencies explicit.
|
||||
- Validation evidence: `tests/test_d1_default_enabled.py` and `tests/test_deploy_script_windows.py`; deployment verifies service state, logs, and persisted config.
|
||||
|
|
@ -147,6 +147,11 @@ value = sys.argv[1].strip().lower() in ("1", "true", "yes", "on")
|
|||
with codecs.open(path, "r", "utf-8-sig") as handle:
|
||||
config = json.load(handle)
|
||||
config["enable_detail_enhancement"] = value
|
||||
schedule_detail = config.get("schedule_detail_config")
|
||||
if not isinstance(schedule_detail, dict):
|
||||
schedule_detail = {}
|
||||
config["schedule_detail_config"] = schedule_detail
|
||||
schedule_detail["enable_detail_enhancement"] = value
|
||||
with codecs.open(path, "w", "utf-8-sig") as handle:
|
||||
json.dump(config, handle, ensure_ascii=False, indent=2)
|
||||
handle.write("\n")
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ class WindowsDeployEntrypointTests(unittest.TestCase):
|
|||
self.assertIn(token, script)
|
||||
self.assertIn('"$PYTHON_BIN" -m unittest discover -s tests -q', script)
|
||||
self.assertIn("shutdown persistence", script)
|
||||
self.assertIn("schedule_detail_config", script)
|
||||
|
||||
def test_powershell_wrapper_supplies_vm_key_and_python(self):
|
||||
wrapper = (ROOT / "ops" / "deploy-plugin.ps1").read_text(encoding="utf-8")
|
||||
|
|
|
|||
正在加载…
添加表格
在新工单中引用