Multiple task managers

I think I read in a post that this is a terrible idea, but I would like to know whether it’s possible. My editor has a “play” feature rather similar to Unity’s and I need it to reflect the final task manager appearing in the built p3d file as accurately as possible. As I have a number of editor only tasks (like running gizmos, etc) running in the default task manager, the user can potentially kill one of these tasks with their own code.

Can anyone suggest a solution to this? Seems like keeping all the editor only tasks in a separate task manager is the cleanest way of achieving what I want.

Are Task Chains what you want?

You could also run your own task manager as one real task in the global taskMgr, minimizing the risk of task name overlapping.
If the users gain access to the task manager, they could also stop whole panda, by the way.

This is a valid reason for abstracting or proxying Python/Panda3D or even running the user code in a separate process.

Thanks for the response guys. So I should be able to attach all my editor only tasks as their own task chain, and dump all non-editor tasks when play mode ends?

That seems reasonable to me.