The agent with by is omitted in passive voice when it is implicit.
I was doing an exercise in which I had to change the sentence
He kept me waiting
into the active voice. According to me the active voice is
I was kept waiting by him
but in the solution by him is omitted. Him can not be omitted because it specifies a particular person. It may be an opportunity also like
I was kept waiting by this opportunity.
What I want to ask is why by him should be omitted.