The idea of having some magical flag that the administrator configures is probably not a good one. The master/agent thing is already too complex to understand for new people. Another model is that the master figures out that the agent being used is localhost and indicates this back to the client. The client can then always do a special case and reuse the entered server name for the agent.
I'm going to go ahead and close this as a duplicate of bug 6144, even though they aren't identical. The issue here is that the user cannot use the default behaviour (i.e. IP address), but for some reason cannot use agent_hostname either. We cannot progress without details on the scenario, so there is no point keeping this open. We can revisit this when we get a new user with this problematic setup, where we can discuss the problem in more detail. *** This bug has been marked as a duplicate of bug 6144 ***