MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getMessagePreview

Function getMessagePreview

scripts/fetch-recent-chat-completion-traces.ts:166–174  ·  view source on GitHub ↗
(message: ChatMessage | undefined)

Source from the content-addressed store, hash-verified

164}
165
166function getMessagePreview(message: ChatMessage | undefined): string {
167 if (!message) return '(none)'
168 const role = typeof message.role === 'string' ? message.role : 'unknown'
169 const content =
170 typeof message.content === 'string'
171 ? message.content
172 : JSON.stringify(message.content)
173 return `${role}: ${redactForPreview((content ?? '').replace(/\s+/g, ' ')).slice(0, 120)}`
174}
175
176function applyMessageDelta(params: {
177 existingMessages: ChatMessage[]

Callers 1

printSummaryFunction · 0.85

Calls 1

redactForPreviewFunction · 0.85

Tested by

no test coverage detected