local triggers: support mid-turn interruption via origin_metadata {"interrupt": true}
Test Suite / Detect changes (push) Canceled after 0s
Test Suite / webui (push) Canceled after 0s
Test Suite / docker (push) Canceled after 0s
Test Suite / Python (Windows, 3.14) (push) Canceled after 0s
Test Suite / Python (minimum, 3.11) (push) Canceled after 0s
Test Suite / Python (latest, 3.14 + coverage) (push) Canceled after 0s
Test Suite / Detect changes (push) Canceled after 0s
Test Suite / webui (push) Canceled after 0s
Test Suite / docker (push) Canceled after 0s
Test Suite / Python (Windows, 3.14) (push) Canceled after 0s
Test Suite / Python (minimum, 3.11) (push) Canceled after 0s
Test Suite / Python (latest, 3.14 + coverage) (push) Canceled after 0s
This commit is contained in:
@@ -44,7 +44,15 @@ def _should_defer_local_trigger_turn(
|
|||||||
session_key: str,
|
session_key: str,
|
||||||
active_session_keys: Iterable[str],
|
active_session_keys: Iterable[str],
|
||||||
) -> bool:
|
) -> bool:
|
||||||
return local_trigger(msg.metadata) is not None and session_key in active_session_keys
|
if not (local_trigger(msg.metadata) is not None and session_key in active_session_keys):
|
||||||
|
return False
|
||||||
|
# Mid-turn interruption requested: the trigger was created with
|
||||||
|
# origin_metadata {"interrupt": true} (copied verbatim into msg.metadata
|
||||||
|
# by the local runner). Skip deferral so the message routes into the
|
||||||
|
# session's pending queue and is injected at the next tool-call boundary.
|
||||||
|
if msg.metadata.get("interrupt"):
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def _local_trigger_id(msg: InboundMessage) -> str | None:
|
def _local_trigger_id(msg: InboundMessage) -> str | None:
|
||||||
|
|||||||
Reference in New Issue
Block a user