fix(gateway_tools,conversations): say refused in user turns, the reply reaches the human itself

This commit is contained in:
hh
2026-08-30 02:26:35 +02:00
parent b4853b9fd0
commit 5d67cfcc9e
3 changed files with 52 additions and 1 deletions
+5
View File
@@ -883,6 +883,11 @@ class Conversations:
self._ensure_worker(cast("int", conv.id))
return item
def turn_origin(self, conv: Conversation) -> str | None:
"""Origin of the running turn (``user``, ``inject``, ...); None when idle."""
runner = self._runners.get(cast("int", conv.id))
return runner.origin if runner is not None and runner.turn_id else None
async def say(self, conv: Conversation, text: str) -> dict[str, Any]:
runner = self._runners.get(cast("int", conv.id))
_log.info("say[%s]: %s", conv.external_id, text[:200])