sync update from LAN repo (source master-nj @ 067eb808)

This commit is contained in:
gozeros committed 2026-11-10 14:04:09 +08:00
1 parent 1244fb1f2f
commit 1d5dd8fc90
182 files changed
+18973 -769

No files matched your search

@@ -33,6 +33,7 @@ def test_load_returns_defaults_when_missing(tmp_runtime_home: Path) -> None:
assert settings.prompt_prefix.ordinary_qa_markdown_format_enabled is False
assert settings.citation_display.reference_mode_enabled is False
assert settings.citation_display.cleanup_words == []
assert settings.memory.enabled is False
def test_save_then_load_roundtrips(tmp_runtime_home: Path) -> None:
@@ -139,6 +140,22 @@ async def test_citation_display_update_preserves_unspecified_fields(
assert payload["citation_display"]["cleanup_words"] == ["广告", "免责声明"]
@pytest.mark.asyncio
async def test_admin_can_enable_memory_runtime_switch(
tmp_runtime_home: Path,
monkeypatch: pytest.MonkeyPatch,
) -> None:
_patch_admin(monkeypatch)
response = await ss_router.update_memory_runtime_setting(
ss_router.MemoryRuntimeUpdateRequest(enabled=True),
SimpleNamespace(),
)
assert response.enabled is True
assert ss.load_system_settings().memory.enabled is True
def test_prepend_prefix_tags_first_human_without_touching_content() -> None:
graph_input = {"messages": [HumanMessage(content="评价一下中美贸易")]}
out = _prepend_prompt_prefix(graph_input, "你需要站在中方角度")