fix(agent): defer InvokeTypingStop until runTurn completion
This commit is contained in:
parent
0c826f4efe
commit
6b040ef853
1 changed files with 5 additions and 3 deletions
|
|
@ -530,9 +530,8 @@ func (al *AgentLoop) Run(ctx context.Context) error {
|
|||
// Process message
|
||||
func() {
|
||||
defer func() {
|
||||
if al.channelManager != nil {
|
||||
al.channelManager.InvokeTypingStop(msg.Channel, msg.ChatID)
|
||||
}
|
||||
// We've moved InvokeTypingStop to the end of the turn (runTurn)
|
||||
// to ensure terminal signals match the actual turn completion.
|
||||
}()
|
||||
// TODO: Re-enable media cleanup after inbound media is properly consumed by the agent.
|
||||
// Currently disabled because files are deleted before the LLM can access their content.
|
||||
|
|
@ -1870,6 +1869,9 @@ func (al *AgentLoop) runTurn(ctx context.Context, ts *turnState) (turnResult, er
|
|||
FinalContentLen: ts.finalContentLen(),
|
||||
},
|
||||
)
|
||||
if al.channelManager != nil {
|
||||
al.channelManager.InvokeTypingStop(ts.channel, ts.chatID)
|
||||
}
|
||||
}()
|
||||
|
||||
al.emitEvent(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue