Update plugins.py

frdel committed Mar 19, 2026 at 17:06 UTC 1dc3405db074646aff7c7be164be9dfb4bab76ba
1 file changed +13 -3
helpers/plugins.py
+13 -3
@@ -128,10 +128,20 @@ def register_watchdogs():
128 print_style.PrintStyle.debug("Plugins watchdog triggered", plugin_names)
129 after_plugin_change(plugin_names or None)
130
131 + relevant_patterns = ["**/extensions/**/*", TOGGLE_FILE_PATTERN, HOOKS_SCRIPT]
132 +
133 + # combine relevant patterns with base path
134 + def expand_patterns(base_path:str):
135 + result = []
136 + for pattern in relevant_patterns:
137 + result.append(base_path+pattern)
138 + return result
139 +
140 # add watchdogs for plugin roots
141 watchdog.add_watchdog(
142 id="plugins_roots",
143 roots=get_plugin_roots(),
144 + patterns = [*expand_patterns("*/")],
145 handler=on_plugin_change,
146 )
147
@@ -143,8 +153,8 @@ def register_watchdogs():
153 id="plugins_projects",
154 roots=[files.get_abs_path(projects.PROJECTS_PARENT_DIR)],
155 patterns=[
146 - f"*/{projects.PROJECT_META_DIR}/plugins/**/*",
147 - f"*/{projects.PROJECT_META_DIR}/agents/*/plugins/**/*",
156 + *expand_patterns(f"*/{projects.PROJECT_META_DIR}/plugins/"),
157 + *expand_patterns(f"*/{projects.PROJECT_META_DIR}/agents/*/plugins/"),
158 ],
159 handler=on_plugin_change,
160 )
@@ -156,7 +166,7 @@ def register_watchdogs():
166 files.get_abs_path(subagents.DEFAULT_AGENTS_DIR),
167 files.get_abs_path(subagents.USER_AGENTS_DIR),
168 ],
159 - patterns=[f"*/plugins/**/*"],
169 + patterns=[*expand_patterns(f"*/plugins/*/")],
170 handler=on_plugin_change,
171 )
172