[medium] fixes to the agent upgrade protocol to support initialization by service