Around 19 BBY, a battle occurred on the planet Agamar during the Clone Wars between the Galactic Republic and Separatist Alliance. Prior to the battle, the ST-series military strategic analysis and tactics droid General Kalani was ordered by Separatist leader, Count Dooku, to await deployment at Agamar alongside the remaining forces from the government's defeat at the planet Onderon in 20 BBY. Above Agamar, however, Kalani's DH-Omni Support Vessel was attacked by Republic forces and crashed on the planet's surface.
Not long after the engagements, following the activation of Order 66, which forced the Republic's Grand Army to execute the Jedi Order, a command was issued by the Sith apprentice Darth Vader that ordered the deactivation of the Separatist Droid Army. However, assuming that it was a Republic trick, Kalani refused the order and left his battle droids online, and they remained on Agamar's surface for seventeen years before being discovered during the reign of the Galactic Empire.
During the Clone Wars between the Galactic Republic and Confederacy of Independent Systems, in 20 BBY, the Separatist Droid Army had suffered several losses on the planet Onderon during their civil war with a group of rebels. In response, the Separatist ST-series military strategic analysis and tactics droid, General Kalani was dispatched to the planet in order to defeat the resistance fighters by Separatist Head of State, Count Dooku. However, following additional losses, Kalani was ordered by Dooku to withdraw the remaining forces from the planet and bring them to the planet Agamar to await deployment.
Around the time of 19 BBY, while awaiting further instructions, Kalani's DH-Omni Support Vessel came under assault from Republic forces above Agamar. As a result, amid the battle, the supply ship crashed onto the planet, which left the droid general and his battle droids abandoned on Agamar's surface while the Clone Wars proceeded to its closure.
Sometime after the Agamar engagements, the Jedi Order was eradicated across the galaxy as the clone troopers of the Grand Army of the Republic received orders from Supreme Chancellor Sheev Palpatine—secretly the Sith Lord Darth Sidious—to execute their Jedi Generals in accordance with Order 66. Following the beginning of the Jedi's purge from the galaxy, the Sith apprentice Darth Vader issued an immediate deactivation command to the Trade Federation, which ordered the shut-down of all battle droid units within the Separatist Droid Army, after his slaughtering of the Executive Separatist Council on the planet Mustafar. In assumption of it being a Republic deception, however, Kalani refused the order and neglected the deactivation of himself and his droid garrison on Agamar.
The battle of Agamar was first mentioned in the new Star Wars canon in "The Last Battle," the sixth episode of the third season of the Star Wars Rebels television series, which aired on October 22, 2016. In the Star Wars Legends continuity, the Mirgoshir campaign was first indirectly mentioned in the Star Wars: The Clone Wars, a 2002 video game published by LucasArts. It was later identified in the StarWars.com Databank entry for the Unstable Terrain Artillery Transport.