From your code snippet it looks as though that code might be running from a
tk-multi-launchapp hook, the reason I say that is that you have
multi_launchapp = self.parent, is that correct?
As you found the Application object has a reference to the context.
Also the engine has a reference to the current context as well.
The best way to get the current session’s context would be to run the following:
# if running in a hook, self.parent will return the parent Application object that is calling the hook.
# From the Application you can get the current engine, which manages and holds the current context.
current_engine = self.parent.engine
current_context = current_engine.current_context
If your code is not running in a hook but an engine is present (though this would also work from within the hook as well), you could run the following:
# Get a handle to the currently running engine.
current_engine = sgtk.platform.current_engine()
current_context = current_engine.context
Does that help?