refactor(loop): extract speak voice backfill into applyBatchVoice (M57)

This commit is contained in:
AskaEth committed 2026-10-27 21:33:05 +08:00
1 parent 39ae883a4e
commit c9da488749
2 files changed
+10 -5

No files matched your search

+1 -5
View File
@@ -187,11 +187,7 @@ func (l *Loop) driveTurn(ctx context.Context, sessionID string, msgs []model.Mes
}
msgs = batch.messages
res.ToolCallsExecuted += batch.executed
// speak 的出站结论逐批回填(M57):后面批次里没有 speak 时保留
// 前面那批的结论 —— 这条回复想用语音这件事发生在哪一批都算数。
if batch.voice != nil {
res.Voice = batch.voice
}
applyBatchVoice(res, &batch)
l.saveCheckpoint(ctx, sessionID, step, msgs, agent.StopReasonToolCalls)
// 关键工具循环安全网(或终止钩子)不等真正的最终答案