MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / ensure_plugins_loaded

Function ensure_plugins_loaded

src/python/runner.cpp:731–763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

729 }
730
731 void ensure_plugins_loaded() {
732 ensure_initialized();
733 if (!can_acquire_gil()) {
734 LOG_WARN("Python GIL state not ready, skipping plugin load");
735 return;
736 }
737
738 std::vector<std::string> to_load;
739 {
740 const GilAcquire gil;
741 std::lock_guard lock(g_plugin_init_mutex);
742 if (!ensure_python_bridge_ready_locked()) {
743 LOG_WARN("Python bridge not ready, skipping plugin load");
744 return;
745 }
746 if (are_plugins_loaded()) {
747 return;
748 }
749 to_load = discover_enabled_plugins_locked();
750 LOG_INFO("Plugin autoload: {} plugin(s) enabled for startup", to_load.size());
751 }
752
753 for (const auto& name : to_load) {
754 const GilAcquire gil;
755 if (load_single_plugin_locked(name)) {
756 LOG_INFO("Loaded plugin: {}", name);
757 } else {
758 LOG_ERROR("Failed to load plugin: {}", name);
759 }
760 }
761
762 mark_plugins_loaded();
763 }
764
765 void preload_user_plugins_async() {
766 if (!env_flag_enabled("LFS_PLUGIN_AUTOLOAD", true)) {

Callers 5

run_scriptsFunction · 0.85
invoke_capabilityFunction · 0.85
has_capabilityFunction · 0.85
list_capabilitiesFunction · 0.85

Calls 8

ensure_initializedFunction · 0.85
can_acquire_gilFunction · 0.85
are_plugins_loadedFunction · 0.85
mark_plugins_loadedFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected