sync update from LAN repo (source dhk-1 @ c21a2a4a)

This commit is contained in:
gozeros committed 2026-11-10 14:04:00 +08:00
1 parent 264e2200d6
commit a1fa13a238
122 files changed
+8881 -623

No files matched your search

@@ -40,7 +40,7 @@ def test_load_returns_defaults_when_missing(tmp_runtime_home: Path) -> None:
assert settings.conversation_context.recent_turn_window_enabled is False
assert settings.conversation_context.max_conversation_rounds == 20
assert settings.write_file_compatibility.enabled is False
assert settings.conversation_context.recent_turn_window_enabled is False
assert settings.call_metrics.enabled is True
def test_save_then_load_roundtrips(tmp_runtime_home: Path) -> None:
@@ -325,6 +325,28 @@ async def test_admin_can_toggle_write_file_compatibility_without_restart(
assert ss.get_write_file_compatibility_settings().enabled is False
@pytest.mark.asyncio
async def test_admin_can_toggle_call_metrics_without_restart(
tmp_runtime_home: Path,
monkeypatch: pytest.MonkeyPatch,
) -> None:
_patch_admin(monkeypatch)
disabled = await ss_router.update_call_metrics_setting(
ss_router.CallMetricsUpdateRequest(enabled=False),
SimpleNamespace(),
)
assert disabled.enabled is False
assert ss.get_call_metrics_settings().enabled is False
enabled = await ss_router.update_call_metrics_setting(
ss_router.CallMetricsUpdateRequest(enabled=True),
SimpleNamespace(),
)
assert enabled.enabled is True
assert ss.get_call_metrics_settings().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, "你需要站在中方角度")