feat(graph): thread the graph abort into llm nodes and tool execution
LlmNodeExecutor::execute now takes the graph's abort signal and threads it through run -> run_with_retries -> run_chat_loop, replacing the loop-private signal, so an in-flight model call is interrupted and every turn starts with an abort check that bails 'llm node aborted' before any client is created. run_llm_function gains an optional abort signal: the synchronous tool wait loop kills the child and returns a 'Tool call ... aborted' error within one poll interval when it is set. The tool dispatcher passes the session abort; the agent _instructions runner passes None.
This commit is contained in:
4 files changed
+105
-8
No files matched your search
@@ -580,7 +580,9 @@ pub(super) async fn step(
|
||||
Ok(StepResult::Continue(vec![next]))
|
||||
}
|
||||
NodeType::Llm(llm_node) => {
|
||||
let outcome = LlmNodeExecutor::execute(current, llm_node, state, ctx).await?;
|
||||
let outcome =
|
||||
LlmNodeExecutor::execute(current, llm_node, state, ctx, step_ctx.abort_signal)
|
||||
.await?;
|
||||
let targets = match outcome {
|
||||
LlmExecutionOutcome::Continue => {
|
||||
static_next_targets(node, current, "llm", step_ctx.branch_mode)?
|
||||
|
||||
Reference in new issue
Block a user