Resolve task reference lazily