def reset()

in backend.py [0:0]


    def reset(cls):
        with cls._lock:
            if cls._instance:
                if hasattr(cls._instance, "model") and cls._instance.model:
                    try:
                        del cls._instance.model
                    except Exception:
                        pass

                if hasattr(cls._instance, "agent") and cls._instance.agent:
                    try:
                        del cls._instance.agent
                    except Exception:
                        pass

                cls._instance = None

        ToolManager.reset()