MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / flush

Function flush

packages/mcp-server/src/format.ts:129–134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127 let pendingTs = 0
128
129 const flush = () => {
130 if (pendingContents.length === 0) return
131 const combined = pendingContents.join('; ')
132 const maxLen = pendingContents.length > 1 ? MAX_MERGED_CONTENT_LENGTH : MAX_CONTENT_LENGTH
133 lines.push(`${formatTimestamp(pendingTs)} ${prevSender}: ${truncate(combined, maxLen)}`)
134 }
135
136 for (const msg of valid) {
137 const content = msg.content!.trim()

Callers 1

formatMessagesCompactFunction · 0.85

Calls 2

truncateFunction · 0.85
formatTimestampFunction · 0.70

Tested by

no test coverage detected