I never tried to put weapons on my freighters, so this may be a stupid question:
Does the designer warn about that? If not it should probably do just that. Maybe weapons on freighters could be forbidden outright, but that would be too restricting.
Having diplomatic repercussions from sending armed ships, including merchants, to other empires' colonies is perfectly okay with me.
ORIGINAL: Interesting
The AI is bugged into thinking a freighter with a beam weapon is a military ship when its not and therefore keeps giving me these messages. One for each race. All the time. Why? Because my freighters trade with those nations all the time.
In my view the bug isn't in the AI, it is a design-flaw in the ship designer, if it lets you construct such ships without a clear warning. But (if no such warning exists) there is a very real issue here.
ORINGINAL: Malevolence
Given the design goal of unarmed merchants, the AI should have been designed to have escorts wait outside the territory of the other empire until the merchant completes its mission -- the escorts should then rejoin their sheep. Also, the AI (or via player command) should also be capable of ordering merchant vessels to leave another empire's territory and restrict travel to their territory. This is particularly important as diplomacy begins to fail and the relationship quickly falls to hostility and war.
Agreed about the need for special handling of escorts around other empires' colonies.
I don't think the player needs any ability to issue direct commands to the merchant fleet. Any outbreak of war should, without player interaction, lead to an immediate withdrawal of all civil crafts from enemy controlled systems. This should go without saying. Maybe what we are seeing in war with all these merchants getting attacked around enemy spaceports is that the AI just reacts slowly, as in 'the poor captains of those ships weren't informed and are just trying to carry out their orders'?
Bad pre-war relations could and probably should automatically reflect on the trade relations. Maybe the set of available relational states (defense pact, free trade, ..., blockade) is a bit thin at the moment and should be expanded to include something that warns about conducting trade but doesn't forbid it? (note: I haven't played with this much yet, apart from trying to get free trade arrangements). There should be a trade-off between different options (in some way there already is): Under bad relations, the existence of trade relations may be that what is keeping the factions from war. If a boycot is imposed, that will send the relationship further down the drain. Note, how trade actually factors into how the empires think about each other currently, although it has relatively small weight.