From 88d1d08561c8e7e87b9d44c3a09402a59aaebb17 Mon Sep 17 00:00:00 2001 From: Luciabrightcode Date: Tue, 23 Dec 2025 15:07:06 +0800 Subject: [PATCH] fix(core): resolve scheduler async syntax error and robust coroutine handling - Handle coroutine objects in addition to functions in dispatch_with_entropy - Prevent RuntimeWarning for unawaited coroutines --- src/core/scheduler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/scheduler.py b/src/core/scheduler.py index 446254e..0073118 100644 --- a/src/core/scheduler.py +++ b/src/core/scheduler.py @@ -36,7 +36,10 @@ class EntropyScheduler: # Pre-execution jitter (simulate human hesitation) await asyncio.sleep(random.uniform(0.1, 0.8)) + # Execute the task if asyncio.iscoroutinefunction(task): await task() + elif asyncio.iscoroutine(task): + await task else: task()