和顺 / 衡律 返回所属 Agent
20.7

用户暂停、接管与未决结果

原能力

接收暂停、停止、降低风险和恢复请求,以原责任域实际回执证明生效。(合同附件 R7 20.7)

首选项目

Temporal Python SDK(MIT,限 SDK)。 Temporal Python SDK

匹配范围

流程暂停、等待、人工中断与接管接口。

源码

Temporal Python SDK · async def wait_condition(

temporalio/workflow/_context.py · 1028–1041 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
async def wait_condition(
    fn: Callable[[], bool],
    *,
    timeout: timedelta | float | None = None,
    timeout_summary: str | None = None,
    event_groups: Sequence[EventGroup] | None = None,
) -> None:
    """Wait on a callback to become true.

    This function returns when the callback returns true (invoked each loop
    iteration) or the timeout has been reached.

    Importantly, using `None` value for ``timeout`` means that no Temporal timer is created. This
    means changing from `None` to a positive value (or the inverse) constitutes a nondeterministic

LangGraph · def interrupt(

libs/langgraph/langgraph/types.py · 913–926 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
def interrupt(
    value: Any, *, response_schema: dict[str, Any] | type | None = None
) -> Any:
    """Interrupt the graph with a resumable exception from within a node.

    The `interrupt` function enables human-in-the-loop workflows by pausing graph
    execution and surfacing a value to the client. This value can communicate context
    or request input required to resume execution.

    In a given node, the first invocation of this function raises a `GraphInterrupt`
    exception, halting execution. The provided `value` is included with the exception
    and sent to the client executing the graph.

    A client resuming the graph must use the [`Command`][langgraph.types.Command]

实现与验收要点

验证在途状态、外部效果、唯一接管人和续行权限。