( ctx context.Context, chat database.Chat, status database.ChatStatus, runResult runChatResult, logger slog.Logger, )
| 9682 | } |
| 9683 | |
| 9684 | func (p *Server) generateFinalTurnStatusLabel( |
| 9685 | ctx context.Context, |
| 9686 | chat database.Chat, |
| 9687 | status database.ChatStatus, |
| 9688 | runResult runChatResult, |
| 9689 | logger slog.Logger, |
| 9690 | ) string { |
| 9691 | if status != database.ChatStatusWaiting { |
| 9692 | return fallbackTurnStatusLabel(status) |
| 9693 | } |
| 9694 | |
| 9695 | assistantText := strings.TrimSpace(runResult.FinalAssistantText) |
| 9696 | if assistantText == "" || runResult.StatusLabelModel == nil { |
| 9697 | return fallbackTurnStatusLabel(status) |
| 9698 | } |
| 9699 | |
| 9700 | statusLabel := p.generateTurnStatusLabel( |
| 9701 | ctx, |
| 9702 | chat, |
| 9703 | status, |
| 9704 | assistantText, |
| 9705 | runResult.FallbackProvider, |
| 9706 | runResult.FallbackModel, |
| 9707 | runResult.StatusLabelModel, |
| 9708 | runResult.FallbackRoute, |
| 9709 | runResult.ProviderKeys, |
| 9710 | runResult.ModelBuildOptions, |
| 9711 | logger, |
| 9712 | p.existingDebugService(), |
| 9713 | runResult.TriggerMessageID, |
| 9714 | runResult.HistoryTipMessageID, |
| 9715 | ) |
| 9716 | if statusLabel == "" { |
| 9717 | return fallbackTurnStatusLabel(status) |
| 9718 | } |
| 9719 | return statusLabel |
| 9720 | } |
| 9721 | |
| 9722 | func (p *Server) dispatchSuccessfulTurnPush( |
| 9723 | ctx context.Context, |
no test coverage detected