From 6c3545d9e9faa2fee5d536be58b5495265999e1f Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Wed, 1 Jul 2026 00:48:37 -0700 Subject: [PATCH] test(cron): fix _make_run_job_patches index drift after env-seam split MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migrating the scheduler-reload seam from a single dotenv.load_dotenv patch to two patches (load_hermes_dotenv + reset_secret_source_cache) lengthened the positional list _make_run_job_patches returns, so the 4 callers that applied patches[0..4] silently dropped the resolve_runtime_provider patch (now at [5]). Under CI's hermetic env (all API keys blanked) auth then failed and AIAgent was never constructed → 'NoneType has no attribute kwargs'. Callers now apply patches[0..5]. Passed locally (keys present) but failed on CI shard 5/8. --- tests/cron/test_scheduler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/cron/test_scheduler.py b/tests/cron/test_scheduler.py index c3947ea5b69..84f3204aa48 100644 --- a/tests/cron/test_scheduler.py +++ b/tests/cron/test_scheduler.py @@ -1225,7 +1225,7 @@ class TestRunJobSessionPersistence: "enabled_toolsets": ["web", "terminal", "file"], } fake_db, patches = self._make_run_job_patches(tmp_path) - with patches[0], patches[1], patches[2], patches[3], patches[4], \ + with patches[0], patches[1], patches[2], patches[3], patches[4], patches[5], \ patch("run_agent.AIAgent") as mock_agent_cls: mock_agent = MagicMock() mock_agent.run_conversation.return_value = {"final_response": "ok"} @@ -1259,7 +1259,7 @@ class TestRunJobSessionPersistence: "enabled_toolsets": ["web", "terminal", "file"], } fake_db, patches = self._make_run_job_patches(tmp_path) - with patches[0], patches[1], patches[2], patches[3], patches[4], \ + with patches[0], patches[1], patches[2], patches[3], patches[4], patches[5], \ patch("run_agent.AIAgent") as mock_agent_cls: mock_agent = MagicMock() mock_agent.run_conversation.return_value = {"final_response": "ok"} @@ -1286,7 +1286,7 @@ class TestRunJobSessionPersistence: "prompt": "hello", } fake_db, patches = self._make_run_job_patches(tmp_path) - with patches[0], patches[1], patches[2], patches[3], patches[4], \ + with patches[0], patches[1], patches[2], patches[3], patches[4], patches[5], \ patch("run_agent.AIAgent") as mock_agent_cls: mock_agent = MagicMock() mock_agent.run_conversation.return_value = {"final_response": "ok"} @@ -1314,7 +1314,7 @@ class TestRunJobSessionPersistence: fake_db, patches = self._make_run_job_patches(tmp_path) # Even if the user has ``hermes tools`` configured to enable web+file # for cron, the per-job override wins. - with patches[0], patches[1], patches[2], patches[3], patches[4], \ + with patches[0], patches[1], patches[2], patches[3], patches[4], patches[5], \ patch("run_agent.AIAgent") as mock_agent_cls, \ patch( "hermes_cli.tools_config._get_platform_tools",