Kalani

General Kalani is a super tactical droid who appeared in Star Wars: The Clone Wars and Star Wars Rebels. He served as a general to the Confederacy of Independent Systems during the Clone Wars.

Star Wars: The Clone Wars
During the Battle of Onderon, Kalani was sent by Count Dooku to aid King Sanjay Rash of Onderon in defeating the resistance movement against the Separatist occupation. However, after continued resistance, Kalani and Dooku came to the conclusion that the fighting on Onderon was not worth the time and resources required, and as such, Dooku ordered the Confederacy to abandon the planet and relocate to Agamar.

Star Wars Rebels
When the war came to an end, the droid army was given a shutdown command. However, Kalani deduced that it was a Republic trick and prevented the shutdown command. For the next fifteen years, Kalani and his forces remained operational on the planet Agamar while the rest of the galaxy fell to the control and tyranny of the Galactic Empire. About two years before the Battle of Yavin, General Kalani and his forces captured the Lothal Rebels and former Captain Rex, who were in search of proton bombs. He challenged the Rebels to one last battle that would end the clone wars on his terms, with Zeb as the hostage they had to save.

When it looked like the Rebels had wone, Kalani almost turned the table only for Ezra to intervene and point out that this battle was irrelevant because "both" sides has the lost; the Empire was the only true winner of the war since Palpatine had played the two sides against each other. According to Ezra's reasoning, the shutdown order was meant to go out, the droids were always meant to lose, and the clones were never meant to beat the droids but their own Jedi commanders. Rex and Kalani were grieved by this but the droid general could not deny Ezra's logic. Ezra asked Kalani why he fought in the war and the tactical droid concluded that the Separatists were fighting against the tyranny of the Republic. Ezra pointed out that the Republic had become the Empire, which was now openly tyrannical. In the end, Kalani agreed that they now shared a common enemy. Their base was then assaulted by Imperial forces who had been dispatched by Governor Pryce. Working together, Kalani and the Rebels conjured up a successful plan to escape the Imperials, and afterwards Kalani and his renaming Battle Droids went their seperate ways, satisfied that the war was over with a victory for both the Republic and the Separatists.