While end-users only get to interact with 10 droid groups (0-9) the game itself can handle many more.
So why not have it so that when a sensor or commander droid is produced, a new group (outside the range of those that the human can select) is created and the droid automatically put in to that group. When units are assigned to it, they also get added to the group.
Note: This would require a droid to have an additional "leaderGroup" property or something like that, so that human player could still assign the group of droids to a normal group.
Anyway, this means that the assignment is now tracked via an .internalGroup property of the droids.
When a droid goes for repairs, it remains assigned -- it remains in the .leaderGroup associated with it's sensor/commander droid.
The sensor/commander, when wanting to do something with it's followers, looks at their DACTION and decides whether they are able to play or not.
The DACTIONS for repairs are quite specific and easily to collate:
https://warzone.atlassian.net/wiki/page ... eId=360512
So if a leader is selected, before marking the followers as selected it checks their DACTION and ignores any that are being repaired/rearmed. Likewise, when the leader wants it's followers to move to a new location, or attack some target, it does the same check and only communicates with those that aren't getting repaired/rearmed.
This way, when a droid goes of for repairs, it remains in the group - it remains assigned to the commander or sensor. And once it's been repaired, it starts receiving commands from it's leader again and gets back in to the action.
This approach would have benefits in the JS API too - it would mean that AI scripters could enumGroup(sensorOrCommander.leaderGroup) to get a list of all units assigned to the sensor or commander.
In turn, this would open a door to allowing "programs" to be applied to sensors / commanders, little javascript brains for them.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO