update
This commit is contained in:
+7
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user