From 7ed5630583171bece87ffd58e7230664ceb86b0c Mon Sep 17 00:00:00 2001 From: A-Dawn <67786671+A-Dawn@users.noreply.github.com> Date: Thu, 16 Apr 2026 11:30:24 +0800 Subject: [PATCH] =?UTF-8?q?test:=E4=BF=AE=E6=AD=A3=E9=85=8D=E7=BD=AEschema?= =?UTF-8?q?=E6=96=AD=E8=A8=80=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 query_memory 配置项的 schema 断言对齐到当前 MemoryConfig 的实际挂载位置,避免把既有 UI 分组结构误判为同步回退。 --- pytests/webui/test_config_schema.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pytests/webui/test_config_schema.py b/pytests/webui/test_config_schema.py index 47310379..8ec256af 100644 --- a/pytests/webui/test_config_schema.py +++ b/pytests/webui/test_config_schema.py @@ -99,13 +99,15 @@ def test_maisaka_is_host_tab_and_mcp_is_attached_to_it(): assert mcp_schema.get("uiParent") == "maisaka" -def test_maisaka_memory_query_config_fields_are_exposed(): - """MaiSaka 长期记忆检索开关和默认条数应出现在配置 schema 中。""" +def test_memory_query_config_fields_are_exposed(): + """query_memory 开关和默认条数应出现在记忆配置 schema 中。""" schema = ConfigSchemaGenerator.generate_schema(Config) - maisaka_schema = schema["nested"]["maisaka"] + memory_schema = schema["nested"]["memory"] - enable_field = next(field for field in maisaka_schema["fields"] if field["name"] == "enable_memory_query_tool") - limit_field = next(field for field in maisaka_schema["fields"] if field["name"] == "memory_query_default_limit") + assert memory_schema.get("uiParent") == "emoji" + + enable_field = next(field for field in memory_schema["fields"] if field["name"] == "enable_memory_query_tool") + limit_field = next(field for field in memory_schema["fields"] if field["name"] == "memory_query_default_limit") assert enable_field["type"] == "boolean" assert enable_field.get("x-widget") == "switch"