We study multi-environment prediction when the environment may directly affect the target, so invariant-representation assumptions can fail. The paper analyzes representations learned by explicitly modeling environment variation and marginalizing it out, and proposes a method based on generalized random-intercept models.