Move the agent initialisation and request into the action context