This commit is contained in:
2026-08-16 18:25:26 +07:00
parent 25f8468696
commit 00447e4dde
+7 -1
View File
@@ -224,6 +224,8 @@ function _agentLoop(agent::yiemAgent)
followUpMsg = take!(agent.followUpChannel)
put!(agent.inputChannel, followUpMsg)
end
processingTask = nothing # reset
result = nothing # reset
else # _processMessage() done and no followUp message.
agent.agentEventSink("_agentLoop 4 agent._state.messages length $(length(agent._state.messages))")
result = agent._state.messages[end]
@@ -233,7 +235,6 @@ function _agentLoop(agent::yiemAgent)
agent.agentEventSink(filtered_content[1].text)
end
processingTask = nothing # reset
newUserMsg = nothing # reset
result = nothing # reset
end
end
@@ -263,6 +264,11 @@ function _agentLoop(agent::yiemAgent)
# spawn new _processMessage() if it is not already running.
if processingTask === nothing
agent.agentEventSink("_agentLoop 5 agent._state.messages length $(length(agent._state.messages))")
# discard all messages in followUpChannel
while isready(agent.followUpChannel)
_ = take!(agent.followUpChannel)
end
# Dispatch message through the processing pipeline
processingTask = @spawn _processMessage(
processMessageInputCh,