Try this
Tsarevich Nicholas is killed during his 1891 tour of Japan by a Japanese nationalist (who used a wooden sword IOTL). His younger brother Georgiy becomes Tsar on the death of Alexander III in 1894, but dies of TB in 1900 (1899 IOTL). His younger brother Mikhail becomes Tsar Mikhail II. He is both smarter and easier to get along with than Nicholas, and has a good relationship with Count Witte, Russian Prime Minister and leading proponent of modernization at court. He marries his cousin Princess Beatrice of Britain and solidifies the Anglo-Russian alliance and then the Triple Entente.
With the help of Witte and other progressives, Tsar Michael avoids war with Japan and adopts a formal constitution binding on the monarchy. However, harsh labor conditions and the breakneck pace of industrialization in Russia still give rise to a militant labor movement and revolutionary secret societies like the Social Democrats (Bolsheviks and Mensheviks). Under their influence, labor militants stage a Paris 1870-style Communard uprising in Moscow around 1910-1914, but are defeated by loyalist troops in savage street fighting. Militant leftists are discredited and executed or exiled. When WWI breaks out, Russia is well positioned to take on this challenge, with a tsar who knows how to listen, a unified industrial and political elite dedicated to victory, and a responsible, Euro-style social democratic opposition.
How's that?