issue #22072: Add caching of agents so tests pass.