Companion also suggests friendship. This is tricky as the agents will have the possibility of being in 2 opposite situations.
Perhaps peer or contender?
I'm not sure where you'll be using the word, but of course if you're using it in the program you can simply code it so the word changes depending on the situation; a simple IF statement.
Product is certainly preferable to item being sold, but have to be a little careful how we use it. This seems like a good working definition of the word:
product a set of identical items produced for sale, e.g. "the new product will double our profits"
products multiple of such sets, e.g. "the two new products will quadruple our profits"
You seem to be asking, how do you refer to a single element of such a set?
We observe product is a mass noun which refers to a set of things. Bars of soap and liters of water use units to identify a discrete part of the mass nouns soap and water. Similarly, unit of product could be used to identify a single item to be sold, although it sounds overly formal and almost academic.
"Check that all the units of product are properly packaged."
"Each unit of product must be tested before going on the shelf."
"Count how many deluxe units of product are in stock."
Another option is to use notional agreement, a grammatical convention that allows a group noun to be used with a plural verb when the individuality of its parts is important. This type of construct sounds strange to me, but it is purportedly not as rare in British English.
"Check that all the product are properly packaged."
"Count how many deluxe product are in stock."
Going by ear, the second example ("Each of the product must be tested") is almost certainly wrong, although a real plural noun would work ("Each of the widgets must be tested"). Either notionally plural nouns are more limited than syntactically plural nouns, or my American ears are balking at something technically acceptable.
Although I hope we all enjoyed this brief look into mass nouns, I suggest you use item or unit in those sentences, or, if applicable, identify the thing being packaged, shelved, or stocked more specifically.
Best Answer
Counterproductive
Oxford: having the opposite of the desired effect: The response to the disaster was unsuccessful and perhaps even counterproductive.
Macmillan: having a result that is the opposite of the one you intended: Research shows that sending young offenders to prison can be counterproductive.
Cambridge: having an effect that is the opposite of what you intend or desire: As a way to improve traffic, widening roads can be counterproductive, as it may just encourage more people to drive.
Collins: achieves the opposite result from the one that you want to achieve: In practice, however, such an attitude is counter-productive.