···1010@patch("think.supervisor.get_agents")
1111def test_spawn_scheduled_agents(mock_get_agents, mock_cortex_request):
1212 """Test that scheduled agents are spawned correctly via Cortex."""
1313+ from think.supervisor import check_scheduled_agents
1414+1315 # Mock agents with one scheduled and one not
1416 mock_get_agents.return_value = {
1517 "todo": {
···3436 "/test/journal/agents/987654321_active.jsonl",
3537 ]
36383737- # Call the function
3939+ # Call the functions (prepare then execute)
3840 with patch.dict(os.environ, {"JOURNAL_PATH": "/test/journal"}, clear=True):
3941 spawn_scheduled_agents()
4242+ check_scheduled_agents()
40434144 # Should spawn 2 agents (todo and another_daily)
4245 assert mock_cortex_request.call_count == 2