I think this is in the wrong place for the protocol to work.    The client won't get here until after the polling loop earlier to ensure that repoman is not pending.

It should be called before polling to see if the account is repoman-pending, and it should always happen.
That probably means demand shouldn't be a counter -- but rather a timestamp as I think you had it before.
Recall: we want to prioritize accounts that have sessions waiting.