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

Method setLastTurnSummaryAsync

coderd/x/chatd/chatd.go:9749–9769  ·  view source on GitHub ↗
(
	ctx context.Context,
	chat database.Chat,
	summary string,
	logger slog.Logger,
)

Source from the content-addressed store, hash-verified

9747}
9748
9749func (p *Server) setLastTurnSummaryAsync(
9750 ctx context.Context,
9751 chat database.Chat,
9752 summary string,
9753 logger slog.Logger,
9754) {
9755 summary = strings.TrimSpace(summary)
9756 if summary == "" {
9757 p.clearLastTurnSummaryAsync(ctx, chat, logger)
9758 return
9759 }
9760 if chat.LastTurnSummary.Valid && strings.TrimSpace(chat.LastTurnSummary.String) == summary {
9761 return
9762 }
9763 // This helper runs during processChat cleanup, while processChat is
9764 // still counted in p.inflight. Do not take inflightMu here because
9765 // drainInflight holds it while waiting.
9766 p.inflight.Go(func() {
9767 p.updateLastTurnSummary(context.WithoutCancel(ctx), chat, chat.UpdatedAt, summary, logger)
9768 })
9769}
9770
9771func (p *Server) clearLastTurnSummaryAsync(
9772 ctx context.Context,

Calls 3

updateLastTurnSummaryMethod · 0.95
GoMethod · 0.80

Tested by

no test coverage detected