In a multi-agent environment an agent has to model its peers as well and learn to communicate to solve goals together. Dealing with other agents is one step up from dealing with objects. Emotion would naturally be linked to the actions of other agents as they affect the completion of one's goals.
Part of your statement is true, and part of it is false.
An agent would need to model the behavior of peers, yes.
But communicate? No. Solve goals together? No.
To coalesce civilization or society? Maybe, maybe not. Socialization among peers is not a prerequisite for agency. Not by a mile.
And certainly not amid a state of nature. Not at all would communication or collaboration become a necessity.
Emotion might become an aspect of investment in hypothetical experiments performed by an agent. Hope that equilibrium might be achieved with less work through communication and collaboration.
But put it this way. A caveman grunts at a wild boar standing on top of a hill. The caveman wishes to discern if the silohette atop the hill is potential food by provoking movement, or an inert object offering the illusory shape of a backlit animal. The boar notices and experiences fear. The boar freezes, hoping the grunt was not directed toward it intentionally.
Is neither an agent? Does the conflict of interests preclude emotion?
The boar models the adversary, and experiences emotion to preserve the equilibrium of staying alive.
The caveman experiences hunger as a loss of equilibrium, which provokes a mixture of anxiety, and unhappiness which may cascade into a malaise or depression as weakness progresses with starvation. The aggression of the hunt is not anger, although anger may arrive incidentally.
Is the grunt communication? Perhaps as much as any tactic might be. Deceptive comminication (bird calls, immitating a female in heat to draw male prey) might still be communication, after all.
But to model nature, there must have been a period of where some agents seemingly existed without peers. But those agents likely experienced emotion before cognizant sentience and a rich awareness of the potential for sentience within peers, which most likely precedes a capacity to communicate.