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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user