Fix some api/client context sharing/plumbing Upstream-commit: 5bdc833e44b8ab64b039849f736f8f8077c17ce4 Component: engine