From d1a0ae9b2682ef1d154eb185d76e3bb18f55361c Mon Sep 17 00:00:00 2001 From: RockChinQ <45992437+RockChinQ@users.noreply.github.com> Date: Sun, 27 Sep 2026 00:55:58 +0000 Subject: [PATCH] fix(plugin): bound shared install readiness --- src/langbot/pkg/plugin/connector.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/langbot/pkg/plugin/connector.py b/src/langbot/pkg/plugin/connector.py index e9675d147..a7d140539 100644 --- a/src/langbot/pkg/plugin/connector.py +++ b/src/langbot/pkg/plugin/connector.py @@ -1950,7 +1950,29 @@ class PluginRuntimeConnector(ManagedRuntimeConnector): if task_context is not None: task_context.set_current_action('waiting for plugin initialization') task_context.metadata['progress_percent'] = 84 - await self._wait_for_installed_plugin_ready(plugin_author, plugin_name, task_context) + startup_timeout = 30.0 + if desired.execution_mode is PluginExecutionMode.SHARED_CERTIFIED: + worker_policy = self.worker_policy or PluginWorkerPolicy( + max_cpus=1.0, + max_memory_mb=512, + max_pids=64, + max_open_files=1024, + max_file_size_mb=128, + ) + startup_timeout = ( + 120.0 + * ( + math.ceil(worker_policy.max_workers / worker_policy.max_concurrent_restarts) + + worker_policy.max_installations + ) + + 5.0 + ) + await self._wait_for_installed_plugin_ready( + plugin_author, + plugin_name, + task_context, + timeout=startup_timeout, + ) if task_context is not None: task_context.set_current_action('refreshing plugin components') task_context.metadata['progress_percent'] = 95