local triggers: support mid-turn interruption via origin_metadata {"interrupt": true}
Test Suite / Detect changes (push) Waiting to run
Test Suite / Python (Windows, 3.14) (push) Blocked by required conditions
Test Suite / Python (minimum, 3.11) (push) Blocked by required conditions
Test Suite / Python (latest, 3.14 + coverage) (push) Blocked by required conditions
Test Suite / webui (push) Waiting to run
Test Suite / docker (push) Waiting to run
Test Suite / Detect changes (push) Waiting to run
Test Suite / Python (Windows, 3.14) (push) Blocked by required conditions
Test Suite / Python (minimum, 3.11) (push) Blocked by required conditions
Test Suite / Python (latest, 3.14 + coverage) (push) Blocked by required conditions
Test Suite / webui (push) Waiting to run
Test Suite / docker (push) Waiting to run
This commit is contained in:
@@ -44,7 +44,15 @@ def _should_defer_local_trigger_turn(
|
||||
session_key: str,
|
||||
active_session_keys: Iterable[str],
|
||||
) -> 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:
|
||||
|
||||
Reference in New Issue
Block a user