Force Rebuild of Custom Entity's Task Menu
After days of painful searching and reading code, I figured it out on my own. It was super easy once I got it. Since I am using a custom permissions handler to determine if a user should see an entity's task, I added cache tags to the AccessResult object that the custom handler returns:

$cache_tags = array('my_custom_entity_type:' . $my_custom_entity-&gt;id());

$access_forbidden = AccessResult::forbidden()-&gt;addCacheTags($cache_tags);


Later when my custom entity changes, I invalidate the tag(s) in the submitForm() function of my custom forms:

\Drupal\Core\Cache\Cache::invalidateTags(array('my_custom_entity_type:' . $my_custom_entity-&gt;id());