builder: Refactor remote context Upstream-commit: ae0f8c7ba16362e869894e0121cf3052069d7fe4 Component: engine