fix(daemon): close discarded coroutines in get_daemon_task_factories

The initial daemon_tasks() call to count tasks created coroutines that
were immediately discarded, triggering RuntimeWarning "coroutine never
awaited". Explicitly close them after counting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
curo1305
2026-05-19 15:53:06 +02:00
parent 68f9007ef0
commit cc24257ab0
+4 -1
View File
@@ -87,7 +87,10 @@ class PluginRegistry:
factories: list[tuple[str, Callable[[], Coroutine]]] = [] # type: ignore[type-arg]
for plugin in self._plugins.values():
try:
n_tasks = len(plugin.daemon_tasks())
initial = plugin.daemon_tasks()
n_tasks = len(initial)
for c in initial:
c.close() # prevent "coroutine never awaited" RuntimeWarning
except Exception:
continue
for i in range(n_tasks):