feat(agent): 补充会话上下文构建单元测试

This commit is contained in:
zl-q
2026-03-12 00:19:04 +08:00
parent 21ba8e4a44
commit 87215f9d41
@@ -57,6 +57,11 @@ async def test_run_agentscope_task_calls_runtime_run(
_fake_get_redis_client,
)
monkeypatch.setattr(tasks_module, "AsyncSessionLocal", lambda: _FakeSessionCtx())
monkeypatch.setattr(
tasks_module,
"_build_recent_context_messages",
lambda **_: [],
)
result = await tasks_module.run_agentscope_task(
{
@@ -107,6 +112,11 @@ async def test_run_agentscope_task_includes_recent_context_messages(
_fake_get_redis_client,
)
monkeypatch.setattr(tasks_module, "AsyncSessionLocal", lambda: _FakeSessionCtx())
monkeypatch.setattr(
tasks_module,
"_build_recent_context_messages",
lambda **_: [],
)
monkeypatch.setattr(
tasks_module,
"_build_recent_context_messages",