From cbe8b127440f9d7d886e244cad109fdd34d299af Mon Sep 17 00:00:00 2001 From: greatmengqi Date: Fri, 17 Apr 2026 00:40:45 +0800 Subject: [PATCH] fix(tests): add app_config kwarg to _fake_create_chat_model mocks The P2-7 commit threaded app_config=app_config into create_chat_model invocations inside make_lead_agent. Two test mocks in test_lead_agent_model_resolution.py intercept create_chat_model with a fake that listed the old kwarg set; they needed app_config=None added to their signature or pytest fails with TypeError on unexpected kwarg. Surfaced by CI in https://github.com/bytedance/deer-flow/actions/runs/24522129902. --- backend/tests/test_lead_agent_model_resolution.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/tests/test_lead_agent_model_resolution.py b/backend/tests/test_lead_agent_model_resolution.py index 437c6cd83..4a5f22e5f 100644 --- a/backend/tests/test_lead_agent_model_resolution.py +++ b/backend/tests/test_lead_agent_model_resolution.py @@ -81,7 +81,7 @@ def test_make_lead_agent_disables_thinking_when_model_does_not_support_it(monkey captured: dict[str, object] = {} - def _fake_create_chat_model(*, name, thinking_enabled, reasoning_effort=None): + def _fake_create_chat_model(*, name, thinking_enabled, reasoning_effort=None, app_config=None): captured["name"] = name captured["thinking_enabled"] = thinking_enabled captured["reasoning_effort"] = reasoning_effort @@ -146,7 +146,7 @@ def test_create_summarization_middleware_uses_configured_model_alias(monkeypatch fake_model = MagicMock() fake_model.with_config.return_value = fake_model - def _fake_create_chat_model(*, name=None, thinking_enabled, reasoning_effort=None): + def _fake_create_chat_model(*, name=None, thinking_enabled, reasoning_effort=None, app_config=None): captured["name"] = name captured["thinking_enabled"] = thinking_enabled captured["reasoning_effort"] = reasoning_effort