            )
        if direction == "in" and (source_agent_path is None or source_agent_id is not None):
            raise TypeError(
                f"""Inbound envelope should have a "source_agent_path" and no "source_agent_id"."""
            )
        if direction == "out" and (source_agent_id is None or source_agent_path is not None):
            raise TypeError(
