MCPcopy Index your code
hub / github.com/simstudioai/sim / truncateUserMessagePreview

Function truncateUserMessagePreview

apps/sim/lib/copilot/request/otel.ts:387–393  ·  view source on GitHub ↗
(raw: unknown)

Source from the content-addressed store, hash-verified

385}
386
387function truncateUserMessagePreview(raw: unknown): string | undefined {
388 if (typeof raw !== 'string') return undefined
389 const collapsed = raw.replace(/\s+/g, ' ').trim()
390 if (!collapsed) return undefined
391 if (collapsed.length <= USER_MESSAGE_PREVIEW_MAX_CHARS) return collapsed
392 return `${collapsed.slice(0, USER_MESSAGE_PREVIEW_MAX_CHARS - 1)}…`
393}
394
395// Request-shape metadata known only after branch resolution. Stamped
396// on the root span for dashboard filtering.

Callers 1

buildAgentSpanAttributesFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected