From 2ad3d1df38fb267ababf1d97db5a034a9362101d Mon Sep 17 00:00:00 2001 From: narawat Date: Tue, 11 Aug 2026 19:10:37 +0700 Subject: [PATCH] update --- src/agentCore.jl | 42 ++++++------------------------------------ src/utils.jl | 2 +- 2 files changed, 7 insertions(+), 37 deletions(-) diff --git a/src/agentCore.jl b/src/agentCore.jl index 1e42a48..98c197c 100644 --- a/src/agentCore.jl +++ b/src/agentCore.jl @@ -834,39 +834,6 @@ function finalizeExecutedToolCall( return finalizedOutcome(prep.toolCall, result, isError) end -""" - emitToolExecutionEnd(finalized, emit) - -Emits the `toolExecutionEnd` event with the finalized outcome, -signalling to listeners that the tool call has completed. - -This event is part of the tool execution lifecycle: -`toolExecutionStart` → (zero or more `toolExecutionUpdate` events) → -`toolExecutionEnd`. Listeners (such as the TUI or logging systems) -use this lifecycle to track individual tool calls. The event carries -the final result so listeners have all the data they need without -requiring external state lookups. - -# Arguments -- `finalized::finalizedOutcome`: The finalized outcome to report -- `emit::Function`: Event emitter - -# Notes -- Part of a three-event lifecycle per tool call -- Carries the complete result so listeners need no external lookups - -# Examples -```julia -# Emits a single event; returns nothing -emitToolExecutionEnd(finalized, emit) -# (emit receives toolExecEndEvent("call_1", "search_wine", result, false)) -``` -""" -function emitToolExecutionEnd(finalized::finalizedOutcome, emit::Function) - emit(toolExecEndEvent(finalized.toolCall.id, finalized.toolCall.name, - finalized.result, finalized.isError)) -end - # ── sequential execution ──────────────────────────────────────── """ @@ -945,7 +912,8 @@ function executeToolCallsSequential( finalized = finalizeExecutedToolCall(context, assistantMsg, prep, executed, config, signal) end - emitToolExecutionEnd(finalized, emit) + emit(toolExecEndEvent(finalized.toolCall.id, finalized.toolCall.name, + finalized.result, finalized.isError)) push!(messages, createToolResultMessage(finalized)) push!(finalizedCalls, finalized) @@ -1032,13 +1000,15 @@ function executeToolCallsParallel( if prep isa immediateOutcome finalized = finalizedOutcome(tc, prep.result, prep.isError) - emitToolExecutionEnd(finalized, emit) + emit(toolExecEndEvent(finalized.toolCall.id, finalized.toolCall.name, + finalized.result, finalized.isError)) push!(entries, finalized) else task = task() do executed = executePreparedToolCall(prep, signal, emit) finalized = finalizeExecutedToolCall(context, assistantMsg, prep, executed, config, signal) - emitToolExecutionEnd(finalized, emit) + emit(toolExecEndEvent(finalized.toolCall.id, finalized.toolCall.name, + finalized.result, finalized.isError)) return finalized end schedule(task) diff --git a/src/utils.jl b/src/utils.jl index 8dc73ad..37848c8 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -244,7 +244,7 @@ end #TODO -function agentEventSink() +function agentEventSink(x) end