fix(trigger): keep local worker alive on turn cancel

This commit is contained in:
chengyongru
2026-07-03 00:36:29 +08:00
committed by Xubin Ren
parent aecb5fbc33
commit 5af22042ec
2 changed files with 41 additions and 0 deletions
+4
View File
@@ -79,6 +79,8 @@ class AutomationTurnCoordinator:
return await future
except asyncio.CancelledError:
raise
except AutomationTurnError:
raise
except Exception as exc:
raise AutomationTurnError(str(exc) or exc.__class__.__name__) from exc
finally:
@@ -118,6 +120,8 @@ class AutomationTurnCoordinator:
if future is None or future.done():
return
if error is not None:
if isinstance(error, asyncio.CancelledError):
error = AutomationTurnError(str(error) or error.__class__.__name__)
future.set_exception(error)
else:
future.set_result(response)