fix bug: agent falsely reports a lost connection with controller when running middle job directly with controller