From 48adc1f6029c3b4adfb6d0470aafbb47316a7903 Mon Sep 17 00:00:00 2001 From: YAMAGUCHI Seiji Date: Sat, 11 Jul 2026 04:38:12 +0900 Subject: [PATCH] test: cover X Search reasoning config propagation --- tests/tools/test_x_search_tool.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/tools/test_x_search_tool.py b/tests/tools/test_x_search_tool.py index b17751d166e36..3a5186f91424b 100644 --- a/tests/tools/test_x_search_tool.py +++ b/tests/tools/test_x_search_tool.py @@ -425,14 +425,15 @@ def test_x_search_honors_config_model_and_timeout(monkeypatch, tmp_path): assert captured["timeout"] == 45 -def test_x_search_honors_config_reasoning_effort(monkeypatch): +def test_x_search_honors_config_reasoning_effort(monkeypatch, tmp_path): """Configured reasoning effort reaches the xAI Responses request.""" from tools.x_search_tool import x_search_tool monkeypatch.setenv("XAI_API_KEY", "xai-test-key") - monkeypatch.setattr( - "tools.x_search_tool._load_x_search_config", - lambda: {"reasoning_effort": "low", "retries": 0}, + monkeypatch.setenv("HERMES_HOME", str(tmp_path)) + (tmp_path / "config.yaml").write_text( + "x_search:\n reasoning_effort: low\n retries: 0\n", + encoding="utf-8", ) captured = {}