MCPcopy Index your code
hub / github.com/coder/coder / generateFinalTurnStatusLabel

Method generateFinalTurnStatusLabel

coderd/x/chatd/chatd.go:9684–9720  ·  view source on GitHub ↗
(
	ctx context.Context,
	chat database.Chat,
	status database.ChatStatus,
	runResult runChatResult,
	logger slog.Logger,
)

Source from the content-addressed store, hash-verified

9682}
9683
9684func (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
9722func (p *Server) dispatchSuccessfulTurnPush(
9723 ctx context.Context,

Calls 3

existingDebugServiceMethod · 0.95
fallbackTurnStatusLabelFunction · 0.85

Tested by

no test coverage detected